78 typedef void value_type;
79 typedef size_t size_type;
80 typedef ptrdiff_t difference_type;
82#if __cplusplus <= 201703L
84 typedef void* pointer;
85 typedef const void* const_pointer;
87 template<
typename _Tp1>
89 {
typedef allocator<_Tp1> other; };
92#if __cplusplus >= 201103L
95 using propagate_on_container_move_assignment =
true_type;
98 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
101#if __cplusplus >= 202002L
104 allocator() =
default;
105 ~allocator() =
default;
107 template<
typename _Up>
108 __attribute__((__always_inline__))
110 allocator(
const allocator<_Up>&)
noexcept { }
133 typedef _Tp value_type;
134 typedef size_t size_type;
135 typedef ptrdiff_t difference_type;
137#if __cplusplus <= 201703L
140 typedef const _Tp* const_pointer;
141 typedef _Tp& reference;
142 typedef const _Tp& const_reference;
144 template<
typename _Tp1>
146 {
typedef allocator<_Tp1>
other; };
149#if __cplusplus >= 201103L
152 using propagate_on_container_move_assignment = true_type;
154 using is_always_equal
155 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
161 __attribute__((__always_inline__))
163 allocator() _GLIBCXX_NOTHROW { }
165 __attribute__((__always_inline__))
167 allocator(
const allocator& __a) _GLIBCXX_NOTHROW
170#if __cplusplus >= 201103L
172 allocator& operator=(
const allocator&) =
default;
175 template<
typename _Tp1>
176 __attribute__((__always_inline__))
178 allocator(
const allocator<_Tp1>&) _GLIBCXX_NOTHROW { }
180 __attribute__((__always_inline__))
181#if __cpp_constexpr_dynamic_alloc
184 ~allocator() _GLIBCXX_NOTHROW { }
186#if __cplusplus > 201703L
187 [[nodiscard,__gnu__::__always_inline__]]
191 if (std::__is_constant_evaluated())
193 if (__builtin_mul_overflow(__n,
sizeof(_Tp), &__n))
194 std::__throw_bad_array_new_length();
195 return static_cast<_Tp*
>(::operator
new(__n));
198 return __allocator_base<_Tp>::allocate(__n, 0);
201 [[__gnu__::__always_inline__]]
203 deallocate(_Tp* __p,
size_t __n)
205 if (std::__is_constant_evaluated())
207 ::operator
delete(__p);
210 __allocator_base<_Tp>::deallocate(__p, __n);
214 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
216 operator==(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW
219#if __cpp_impl_three_way_comparison < 201907L
220 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
222 operator!=(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW