59 typedef _Tp value_type;
60 typedef std::size_t size_type;
61 typedef std::ptrdiff_t difference_type;
62#if __cplusplus <= 201703L
64 typedef const _Tp* const_pointer;
65 typedef _Tp& reference;
66 typedef const _Tp& const_reference;
68 template<
typename _Tp1>
73#if __cplusplus >= 201103L
85 template<
typename _Tp1>
89#if __cplusplus <= 201703L
101#if __has_builtin(__builtin_operator_new) >= 201802L
102# define _GLIBCXX_OPERATOR_NEW __builtin_operator_new
103# define _GLIBCXX_OPERATOR_DELETE __builtin_operator_delete
105# define _GLIBCXX_OPERATOR_NEW ::operator new
106# define _GLIBCXX_OPERATOR_DELETE ::operator delete
111 _GLIBCXX_NODISCARD _Tp*
112 allocate(size_type __n,
const void* =
static_cast<const void*
>(0))
114#if __cplusplus >= 201103L
117 static_assert(
sizeof(_Tp) != 0,
"cannot allocate incomplete types");
124 if (__n > (std::size_t(-1) /
sizeof(_Tp)))
125 std::__throw_bad_array_new_length();
126 std::__throw_bad_alloc();
132 std::align_val_t
__al = std::align_val_t(
alignof(_Tp));
133 return static_cast<_Tp*
>(_GLIBCXX_OPERATOR_NEW(__n *
sizeof(_Tp),
137 return static_cast<_Tp*
>(_GLIBCXX_OPERATOR_NEW(__n *
sizeof(_Tp)));
144#if __cpp_sized_deallocation
145# define _GLIBCXX_SIZED_DEALLOC(p, n) (p), (n) * sizeof(_Tp)
147# define _GLIBCXX_SIZED_DEALLOC(p, n) (p)
153 _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n),
154 std::align_val_t(
alignof(_Tp)));
158 _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
161#undef _GLIBCXX_SIZED_DEALLOC
162#undef _GLIBCXX_OPERATOR_DELETE
163#undef _GLIBCXX_OPERATOR_NEW
165#if __cplusplus <= 201703L
168 {
return _M_max_size(); }
170#if __cplusplus >= 201103L
171 template<
typename _Up,
typename...
_Args>
177 template<
typename _Up>
186 construct(pointer __p,
const _Tp& __val)
187 { ::new((
void *)__p) _Tp(__val); }
190 destroy(pointer __p) { __p->~_Tp(); }
194 template<
typename _Up>
200#if __cpp_impl_three_way_comparison < 201907L
201 template<
typename _Up>
212#if __PTRDIFF_MAX__ < __SIZE_MAX__
215 return std::size_t(-1) /
sizeof(_Tp);