131 typedef _Tp value_type;
132 typedef size_t size_type;
133 typedef ptrdiff_t difference_type;
135#if __cplusplus <= 201703L
138 typedef const _Tp* const_pointer;
139 typedef _Tp& reference;
140 typedef const _Tp& const_reference;
142 template<
typename _Tp1>
144 {
typedef allocator<_Tp1>
other; };
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())
205 ::operator
delete(__p);
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