44 #define _ALLOCATOR_H 1
48 #if __cplusplus >= 201103L
52 #define __cpp_lib_incomplete_container_elements 201505L
54 namespace std _GLIBCXX_VISIBILITY(default)
56 _GLIBCXX_BEGIN_NAMESPACE_VERSION
75 typedef void value_type;
76 typedef size_t size_type;
77 typedef ptrdiff_t difference_type;
79 #if __cplusplus <= 201703L
81 typedef void* pointer;
82 typedef const void* const_pointer;
84 template<
typename _Tp1>
89 #if __cplusplus >= 201103L
95 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
98 #if __cplusplus >= 202002L
104 template<
typename _Up>
123 template<
typename _Tp>
127 typedef _Tp value_type;
128 typedef size_t size_type;
129 typedef ptrdiff_t difference_type;
131 #if __cplusplus <= 201703L
133 typedef _Tp* pointer;
134 typedef const _Tp* const_pointer;
135 typedef _Tp& reference;
136 typedef const _Tp& const_reference;
138 template<
typename _Tp1>
143 #if __cplusplus >= 201103L
149 _GLIBCXX20_DEPRECATED_SUGGEST(
"std::allocator_traits::is_always_equal")
162 #if __cplusplus >= 201103L
167 template<
typename _Tp1>
171 #if __cpp_constexpr_dynamic_alloc
176 #if __cplusplus > 201703L
177 [[nodiscard,__gnu__::__always_inline__]]
181 if (std::__is_constant_evaluated())
183 if (__builtin_mul_overflow(__n,
sizeof(_Tp), &__n))
184 std::__throw_bad_array_new_length();
185 return static_cast<_Tp*
>(::operator
new(__n));
191 [[__gnu__::__always_inline__]]
193 deallocate(_Tp* __p,
size_t __n)
195 if (std::__is_constant_evaluated())
197 ::operator
delete(__p);
204 friend _GLIBCXX20_CONSTEXPR
bool
208 #if __cpp_impl_three_way_comparison < 201907L
209 friend _GLIBCXX20_CONSTEXPR
bool
217 template<
typename _T1,
typename _T2>
218 inline _GLIBCXX20_CONSTEXPR
bool
223 #if __cpp_impl_three_way_comparison < 201907L
224 template<
typename _T1,
typename _T2>
225 inline _GLIBCXX20_CONSTEXPR
bool
226 operator!=(
const allocator<_T1>&,
const allocator<_T2>&)
233 template<
typename _Tp>
234 class allocator<const _Tp>
237 typedef _Tp value_type;
238 template<
typename _Up> allocator(
const allocator<_Up>&) { }
241 template<
typename _Tp>
242 class allocator<volatile _Tp>
245 typedef _Tp value_type;
246 template<
typename _Up> allocator(
const allocator<_Up>&) { }
249 template<
typename _Tp>
250 class allocator<const volatile _Tp>
253 typedef _Tp value_type;
254 template<
typename _Up> allocator(
const allocator<_Up>&) { }
261 #if _GLIBCXX_EXTERN_TEMPLATE
262 extern template class allocator<char>;
263 extern template class allocator<wchar_t>;
267 #undef __allocator_base
270 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
272 {
static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
274 template<
typename _Alloc>
275 struct __alloc_swap<_Alloc, false>
278 _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
287 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
291 _S_do_it(
const _Alloc&,
const _Alloc&)
295 template<
typename _Alloc>
296 struct __alloc_neq<_Alloc, false>
299 _S_do_it(
const _Alloc& __one,
const _Alloc& __two)
300 {
return __one != __two; }
303 #if __cplusplus >= 201103L
304 template<
typename _Tp,
bool
305 = __or_<is_copy_constructible<typename _Tp::value_type>,
306 is_nothrow_move_constructible<typename _Tp::value_type>>::value>
307 struct __shrink_to_fit_aux
308 {
static bool _S_do_it(_Tp&) noexcept {
return false; } };
310 template<
typename _Tp>
311 struct __shrink_to_fit_aux<_Tp, true>
315 _S_do_it(_Tp& __c) noexcept
320 _Tp(__make_move_if_noexcept_iterator(__c.begin()),
321 __make_move_if_noexcept_iterator(__c.end()),
322 __c.get_allocator()).swap(__c);
334 _GLIBCXX_END_NAMESPACE_VERSION
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
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].