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
69 #if ! _GLIBCXX_INLINE_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
96 #if __cplusplus >= 202002L
99 template<
typename _Up>
112 template<
typename _Up,
typename... _Args>
114 construct(_Up* __p, _Args&&... __args)
116 { ::new((
void *)__p) _Up(std::forward<_Args>(__args)...); }
118 template<
typename _Up>
137 template<
typename _Tp>
141 typedef _Tp value_type;
142 typedef size_t size_type;
143 typedef ptrdiff_t difference_type;
145 #if __cplusplus <= 201703L
147 typedef _Tp* pointer;
148 typedef const _Tp* const_pointer;
149 typedef _Tp& reference;
150 typedef const _Tp& const_reference;
152 template<
typename _Tp1>
157 #if __cplusplus >= 201103L
174 #if __cplusplus >= 201103L
179 template<
typename _Tp1>
183 #if __cpp_constexpr_dynamic_alloc
188 #if __cplusplus > 201703L
189 [[nodiscard,__gnu__::__always_inline__]]
193 #ifdef __cpp_lib_is_constant_evaluated
194 if (std::is_constant_evaluated())
195 return static_cast<_Tp*
>(::operator
new(__n *
sizeof(_Tp)));
200 [[__gnu__::__always_inline__]]
202 deallocate(_Tp* __p,
size_t __n)
204 #ifdef __cpp_lib_is_constant_evaluated
205 if (std::is_constant_evaluated())
207 ::operator
delete(__p);
215 friend _GLIBCXX20_CONSTEXPR
bool
219 #if __cpp_impl_three_way_comparison < 201907L
220 friend _GLIBCXX20_CONSTEXPR
bool
228 template<
typename _T1,
typename _T2>
229 inline _GLIBCXX20_CONSTEXPR
bool
234 #if __cpp_impl_three_way_comparison < 201907L
235 template<
typename _T1,
typename _T2>
236 inline _GLIBCXX20_CONSTEXPR
bool
237 operator!=(
const allocator<_T1>&,
const allocator<_T2>&)
244 template<
typename _Tp>
245 class allocator<const _Tp>
248 typedef _Tp value_type;
249 template<
typename _Up> allocator(
const allocator<_Up>&) { }
252 template<
typename _Tp>
253 class allocator<volatile _Tp>
256 typedef _Tp value_type;
257 template<
typename _Up> allocator(
const allocator<_Up>&) { }
260 template<
typename _Tp>
261 class allocator<const volatile _Tp>
264 typedef _Tp value_type;
265 template<
typename _Up> allocator(
const allocator<_Up>&) { }
272 #if _GLIBCXX_EXTERN_TEMPLATE
273 extern template class allocator<char>;
274 extern template class allocator<wchar_t>;
278 #undef __allocator_base
281 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
283 {
static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
285 template<
typename _Alloc>
286 struct __alloc_swap<_Alloc, false>
289 _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
298 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
302 _S_do_it(
const _Alloc&,
const _Alloc&)
306 template<
typename _Alloc>
307 struct __alloc_neq<_Alloc, false>
310 _S_do_it(
const _Alloc& __one,
const _Alloc& __two)
311 {
return __one != __two; }
314 #if __cplusplus >= 201103L
315 template<
typename _Tp,
bool
316 = __or_<is_copy_constructible<typename _Tp::value_type>,
317 is_nothrow_move_constructible<typename _Tp::value_type>>::value>
318 struct __shrink_to_fit_aux
319 {
static bool _S_do_it(_Tp&) noexcept {
return false; } };
321 template<
typename _Tp>
322 struct __shrink_to_fit_aux<_Tp, true>
325 _S_do_it(_Tp& __c) noexcept
330 _Tp(__make_move_if_noexcept_iterator(__c.begin()),
331 __make_move_if_noexcept_iterator(__c.end()),
332 __c.get_allocator()).swap(__c);
344 _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.
Uniform interface to all allocator types.
The standard allocator, as per C++03 [20.4.1].
An allocator that uses global new, as per C++03 [20.4.1].