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>
104 #endif // C++11 to C++17 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 220 template<
typename _Tp>
224 typedef _Tp value_type;
228 template<
typename _Tp>
232 typedef _Tp value_type;
236 template<
typename _Tp>
240 typedef _Tp value_type;
248 #if _GLIBCXX_EXTERN_TEMPLATE 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>,
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
An allocator that uses global new, as per [20.4].This is precisely the allocator defined in the C++ S...
is_nothrow_move_constructible
The standard allocator, as per [20.4].
ISO C++ entities toplevel namespace is std.