44 #define _ALLOCATOR_H 1
48 #if __cplusplus >= 201103L
52 #define __cpp_lib_incomplete_container_elements 201505
54 namespace std _GLIBCXX_VISIBILITY(default)
56 _GLIBCXX_BEGIN_NAMESPACE_VERSION
68 typedef void value_type;
69 typedef size_t size_type;
70 typedef ptrdiff_t difference_type;
71 #if __cplusplus <= 201703L
72 typedef void* pointer;
73 typedef const void* const_pointer;
75 template<
typename _Tp1>
81 template<
typename _Up>
86 #if __cplusplus >= 201103L && __cplusplus <= 201703L
93 template<
typename _Up,
typename... _Args>
95 construct(_Up* __p, _Args&&... __args)
97 { ::new((
void *)__p) _Up(std::forward<_Args>(__args)...); }
99 template<
typename _Up>
115 template<
typename _Tp>
119 typedef _Tp value_type;
120 typedef size_t size_type;
121 typedef ptrdiff_t difference_type;
122 #if __cplusplus <= 201703L
123 typedef _Tp* pointer;
124 typedef const _Tp* const_pointer;
125 typedef _Tp& reference;
126 typedef const _Tp& const_reference;
128 template<
typename _Tp1>
133 #if __cplusplus >= 201103L
150 #if __cplusplus >= 201103L
155 template<
typename _Tp1>
159 #if __cpp_constexpr_dynamic_alloc
164 #if __cplusplus > 201703L
165 [[nodiscard,__gnu__::__always_inline__]]
169 #ifdef __cpp_lib_is_constant_evaluated
170 if (std::is_constant_evaluated())
171 return static_cast<_Tp*
>(::operator
new(__n *
sizeof(_Tp)));
176 [[__gnu__::__always_inline__]]
178 deallocate(_Tp* __p,
size_t __n)
180 #ifdef __cpp_lib_is_constant_evaluated
181 if (std::is_constant_evaluated())
183 ::operator
delete(__p);
191 friend _GLIBCXX20_CONSTEXPR
bool
195 #if __cpp_impl_three_way_comparison < 201907L
196 friend _GLIBCXX20_CONSTEXPR
bool
204 template<
typename _T1,
typename _T2>
205 inline _GLIBCXX20_CONSTEXPR
bool
210 #if __cpp_impl_three_way_comparison < 201907L
211 template<
typename _T1,
typename _T2>
212 inline _GLIBCXX20_CONSTEXPR
bool
213 operator!=(
const allocator<_T1>&,
const allocator<_T2>&)
220 template<
typename _Tp>
221 class allocator<const _Tp>
224 typedef _Tp value_type;
225 template<
typename _Up> allocator(
const allocator<_Up>&) { }
228 template<
typename _Tp>
229 class allocator<volatile _Tp>
232 typedef _Tp value_type;
233 template<
typename _Up> allocator(
const allocator<_Up>&) { }
236 template<
typename _Tp>
237 class allocator<const volatile _Tp>
240 typedef _Tp value_type;
241 template<
typename _Up> allocator(
const allocator<_Up>&) { }
248 #if _GLIBCXX_EXTERN_TEMPLATE
249 extern template class allocator<char>;
250 extern template class allocator<wchar_t>;
254 #undef __allocator_base
257 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
259 {
static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
261 template<
typename _Alloc>
262 struct __alloc_swap<_Alloc, false>
265 _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
274 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
278 _S_do_it(
const _Alloc&,
const _Alloc&)
282 template<
typename _Alloc>
283 struct __alloc_neq<_Alloc, false>
286 _S_do_it(
const _Alloc& __one,
const _Alloc& __two)
287 {
return __one != __two; }
290 #if __cplusplus >= 201103L
291 template<
typename _Tp,
bool
292 = __or_<is_copy_constructible<typename _Tp::value_type>,
293 is_nothrow_move_constructible<typename _Tp::value_type>>::value>
294 struct __shrink_to_fit_aux
295 {
static bool _S_do_it(_Tp&) noexcept {
return false; } };
297 template<
typename _Tp>
298 struct __shrink_to_fit_aux<_Tp, true>
301 _S_do_it(_Tp& __c) noexcept
306 _Tp(__make_move_if_noexcept_iterator(__c.begin()),
307 __make_move_if_noexcept_iterator(__c.end()),
308 __c.get_allocator()).swap(__c);
320 _GLIBCXX_END_NAMESPACE_VERSION
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 [20.4].
An allocator that uses global new, as per [20.4].