48#if __cplusplus >= 201103L
52namespace std _GLIBCXX_VISIBILITY(default)
54_GLIBCXX_BEGIN_NAMESPACE_VERSION
76 typedef void value_type;
77 typedef size_t size_type;
78 typedef ptrdiff_t difference_type;
80#if __cplusplus <= 201703L
82 typedef void* pointer;
83 typedef const void* const_pointer;
85 template<
typename _Tp1>
90#if __cplusplus >= 201103L
93 using propagate_on_container_move_assignment =
true_type;
96 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
99#if __cplusplus >= 202002L
105 template<
typename _Up>
106 __attribute__((__always_inline__))
127 template<
typename _Tp>
131 typedef _Tp value_type;
132 typedef size_t size_type;
133 typedef ptrdiff_t difference_type;
135#if __cplusplus <= 201703L
137 typedef _Tp* pointer;
138 typedef const _Tp* const_pointer;
139 typedef _Tp& reference;
140 typedef const _Tp& const_reference;
142 template<
typename _Tp1>
147#if __cplusplus >= 201103L
150 using propagate_on_container_move_assignment =
true_type;
152 using is_always_equal
153 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
159 __attribute__((__always_inline__))
161 allocator() _GLIBCXX_NOTHROW { }
163 __attribute__((__always_inline__))
165 allocator(
const allocator& __a) _GLIBCXX_NOTHROW
168#if __cplusplus >= 201103L
170 allocator& operator=(
const allocator&) =
default;
173 template<
typename _Tp1>
174 __attribute__((__always_inline__))
176 allocator(
const allocator<_Tp1>&) _GLIBCXX_NOTHROW { }
178 __attribute__((__always_inline__))
179#if __cpp_constexpr_dynamic_alloc
182 ~allocator() _GLIBCXX_NOTHROW { }
184#if __cplusplus > 201703L
185 [[nodiscard,__gnu__::__always_inline__]]
189 if (std::__is_constant_evaluated())
191 if (__builtin_mul_overflow(__n,
sizeof(_Tp), &__n))
192 std::__throw_bad_array_new_length();
193 return static_cast<_Tp*
>(
::operator new(__n));
196 return __allocator_base<_Tp>::allocate(__n, 0);
199 [[__gnu__::__always_inline__]]
201 deallocate(_Tp* __p,
size_t __n)
203 if (std::__is_constant_evaluated())
208 __allocator_base<_Tp>::deallocate(__p, __n);
212 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
214 operator==(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW
217#if __cpp_impl_three_way_comparison < 201907L
218 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
220 operator!=(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW
232 template<
typename _T1,
typename _T2>
233 __attribute__((__always_inline__))
234 inline _GLIBCXX20_CONSTEXPR
bool
239#if __cpp_impl_three_way_comparison < 201907L
240 template<
typename _T1,
typename _T2>
241 __attribute__((__always_inline__))
242 inline _GLIBCXX20_CONSTEXPR
bool
252 template<
typename _Tp>
253 class allocator<const _Tp>
256 typedef _Tp value_type;
258 template<
typename _Up> allocator(
const allocator<_Up>&) { }
261 template<
typename _Tp>
262 class allocator<volatile _Tp>
265 typedef _Tp value_type;
267 template<
typename _Up> allocator(
const allocator<_Up>&) { }
270 template<
typename _Tp>
271 class allocator<const volatile _Tp>
274 typedef _Tp value_type;
276 template<
typename _Up> allocator(
const allocator<_Up>&) { }
284#if _GLIBCXX_EXTERN_TEMPLATE
285 extern template class allocator<char>;
286 extern template class allocator<wchar_t>;
290#undef __allocator_base
292_GLIBCXX_END_NAMESPACE_VERSION
strong_ordering operator(const error_code &__lhs, const error_code &__rhs) noexcept
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
__new_allocator< _Tp > __allocator_base
An alias to the base class for std::allocator.
constexpr bool operator==(const allocator< _T1 > &, const allocator< _T2 > &) noexcept
ISO C++ entities toplevel namespace is std.
The standard allocator, as per C++03 [20.4.1].
An allocator that uses global new, as per C++03 [20.4.1].