136 typedef _Tp value_type;
137 typedef size_t size_type;
138 typedef ptrdiff_t difference_type;
140#if __cplusplus <= 201703L
143 typedef const _Tp* const_pointer;
144 typedef _Tp& reference;
145 typedef const _Tp& const_reference;
147 template<
typename _Tp1>
149 {
typedef allocator<_Tp1>
other; };
152#if __cplusplus >= 201103L
155 using propagate_on_container_move_assignment = true_type;
157#if __cplusplus <= 202302L
158 using is_always_equal
159 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
166 __attribute__((__always_inline__))
168 allocator() _GLIBCXX_NOTHROW { }
170 __attribute__((__always_inline__))
172 allocator(
const allocator& __a) _GLIBCXX_NOTHROW
175#if __cplusplus >= 201103L
177 allocator& operator=(
const allocator&) =
default;
180 template<
typename _Tp1>
181 __attribute__((__always_inline__))
183 allocator(
const allocator<_Tp1>&) _GLIBCXX_NOTHROW { }
185 __attribute__((__always_inline__))
186#if __cpp_constexpr_dynamic_alloc
189 ~allocator() _GLIBCXX_NOTHROW { }
191#if __cplusplus > 201703L
192 [[nodiscard,__gnu__::__always_inline__]]
196 if (std::__is_constant_evaluated())
198 if (__builtin_mul_overflow(__n,
sizeof(_Tp), &__n))
199 std::__throw_bad_array_new_length();
200 return static_cast<_Tp*
>(::operator
new(__n));
203 return __allocator_base<_Tp>::allocate(__n, 0);
206 [[__gnu__::__always_inline__]]
208 deallocate(_Tp* __p,
size_t __n)
210 if (std::__is_constant_evaluated())
212 ::operator
delete(__p);
215 __allocator_base<_Tp>::deallocate(__p, __n);
219 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
221 operator==(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW
224#if __cpp_impl_three_way_comparison < 201907L
225 friend __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
227 operator!=(
const allocator&,
const allocator&) _GLIBCXX_NOTHROW