66 typedef _Tp value_type;
67 typedef std::size_t size_type;
68 typedef std::ptrdiff_t difference_type;
69#if __cplusplus <= 201703L
71 typedef const _Tp* const_pointer;
72 typedef _Tp& reference;
73 typedef const _Tp& const_reference;
75 template<
typename _Tp1>
80#if __cplusplus >= 201103L
92 template<
typename _Tp1>
96#if __cplusplus >= 201103L
100#if __cplusplus <= 201703L
112#if __has_builtin(__builtin_operator_new) >= 201802L
113# define _GLIBCXX_OPERATOR_NEW __builtin_operator_new
114# define _GLIBCXX_OPERATOR_DELETE __builtin_operator_delete
116# define _GLIBCXX_OPERATOR_NEW ::operator new
117# define _GLIBCXX_OPERATOR_DELETE ::operator delete
122 _GLIBCXX_NODISCARD _Tp*
123 allocate(size_type __n,
const void* =
static_cast<const void*
>(0))
125#if __cplusplus >= 201103L
128 static_assert(
sizeof(_Tp) != 0,
"cannot allocate incomplete types");
135 if (__n > (std::size_t(-1) /
sizeof(_Tp)))
136 std::__throw_bad_array_new_length();
137 std::__throw_bad_alloc();
143 std::align_val_t
__al = std::align_val_t(
alignof(_Tp));
144 return static_cast<_Tp*
>(_GLIBCXX_OPERATOR_NEW(__n *
sizeof(_Tp),
148 return static_cast<_Tp*
>(_GLIBCXX_OPERATOR_NEW(__n *
sizeof(_Tp)));
155#if __cpp_sized_deallocation
156# define _GLIBCXX_SIZED_DEALLOC(p, n) (p), (n) * sizeof(_Tp)
158# define _GLIBCXX_SIZED_DEALLOC(p, n) (p)
164 _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n),
165 std::align_val_t(
alignof(_Tp)));
169 _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
172#undef _GLIBCXX_SIZED_DEALLOC
173#undef _GLIBCXX_OPERATOR_DELETE
174#undef _GLIBCXX_OPERATOR_NEW
176#if __cplusplus <= 201703L
179 {
return _M_max_size(); }
181#if __cplusplus >= 201103L
182 template<
typename _Up,
typename...
_Args>
188 template<
typename _Up>
197 construct(pointer __p,
const _Tp& __val)
198 { ::new((
void *)__p) _Tp(__val); }
201 destroy(pointer __p) { __p->~_Tp(); }
205 template<
typename _Up>
211#if __cpp_impl_three_way_comparison < 201907L
212 template<
typename _Up>
223#if __PTRDIFF_MAX__ < __SIZE_MAX__
226 return std::size_t(-1) /
sizeof(_Tp);