48#if __cplusplus >= 201103L
52#pragma GCC diagnostic push
53#pragma GCC diagnostic ignored "-Wc++11-extensions"
55namespace std _GLIBCXX_VISIBILITY(default)
57_GLIBCXX_BEGIN_NAMESPACE_VERSION
79 typedef void value_type;
80 typedef size_t size_type;
81 typedef ptrdiff_t difference_type;
83#if __cplusplus <= 201703L
85 typedef void* pointer;
86 typedef const void* const_pointer;
88 template<
typename _Tp1>
93#if __cplusplus >= 201103L
96 using propagate_on_container_move_assignment =
true_type;
99 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
102#if __cplusplus >= 202002L
108 template<
typename _Up>
109 __attribute__((__always_inline__))
130 template<
typename _Tp>
134 typedef _Tp value_type;
135 typedef size_t size_type;
136 typedef ptrdiff_t difference_type;
138#if __cplusplus <= 201703L
140 typedef _Tp* pointer;
141 typedef const _Tp* const_pointer;
142 typedef _Tp& reference;
143 typedef const _Tp& const_reference;
145 template<
typename _Tp1>
150#if __cplusplus >= 201103L
153 using propagate_on_container_move_assignment =
true_type;
155 using is_always_equal
156 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
162 __attribute__((__always_inline__))
164 allocator() _GLIBCXX_NOTHROW { }
166 __attribute__((__always_inline__))
168 allocator(
const allocator& __a) _GLIBCXX_NOTHROW
171#if __cplusplus >= 201103L
173 allocator& operator=(
const allocator&) =
default;
176 template<
typename _Tp1>
177 __attribute__((__always_inline__))
179 allocator(
const allocator<_Tp1>&) _GLIBCXX_NOTHROW { }
181 __attribute__((__always_inline__))
182#if __cpp_constexpr_dynamic_alloc
185 ~allocator() _GLIBCXX_NOTHROW { }
187#if __cplusplus > 201703L
188 [[nodiscard,__gnu__::__always_inline__]]
192 if (std::__is_constant_evaluated())
194 if (__builtin_mul_overflow(__n,
sizeof(_Tp), &__n))
195 std::__throw_bad_array_new_length();
196 return static_cast<_Tp*
>(
::operator new(__n));
199 return __allocator_base<_Tp>::allocate(__n, 0);
202 [[__gnu__::__always_inline__]]
204 deallocate(_Tp* __p,
size_t __n)
206 if (std::__is_constant_evaluated())
211 __allocator_base<_Tp>::deallocate(__p, __n);
215 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
217 operator==(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW
220#if __cpp_impl_three_way_comparison < 201907L
221 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
223 operator!=(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW
235 template<
typename _T1,
typename _T2>
236 __attribute__((__always_inline__))
237 inline _GLIBCXX20_CONSTEXPR
bool
242#if __cpp_impl_three_way_comparison < 201907L
243 template<
typename _T1,
typename _T2>
244 __attribute__((__always_inline__))
245 inline _GLIBCXX20_CONSTEXPR
bool
255 template<
typename _Tp>
256 class allocator<const _Tp>
259 typedef _Tp value_type;
261 template<
typename _Up> allocator(
const allocator<_Up>&) { }
264 template<
typename _Tp>
265 class allocator<volatile _Tp>
268 typedef _Tp value_type;
270 template<
typename _Up> allocator(
const allocator<_Up>&) { }
273 template<
typename _Tp>
274 class allocator<const volatile _Tp>
277 typedef _Tp value_type;
279 template<
typename _Up> allocator(
const allocator<_Up>&) { }
287#if _GLIBCXX_EXTERN_TEMPLATE
288 extern template class allocator<char>;
289 extern template class allocator<wchar_t>;
293#undef __allocator_base
295_GLIBCXX_END_NAMESPACE_VERSION
298#pragma GCC diagnostic pop
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].