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 95 _GLIBCXX20_DEPRECATED_SUGGEST(
"allocator_traits::is_always_equal")
98 #if __cplusplus >= 202002L 101 template<
typename _Up>
114 template<
typename _Up,
typename... _Args>
116 construct(_Up* __p, _Args&&... __args)
118 { ::new((
void *)__p) _Up(std::forward<_Args>(__args)...); }
120 template<
typename _Up>
129 #endif // ! _GLIBCXX_INLINE_VERSION 139 template<
typename _Tp>
143 typedef _Tp value_type;
144 typedef size_t size_type;
145 typedef ptrdiff_t difference_type;
147 #if __cplusplus <= 201703L 149 typedef _Tp* pointer;
150 typedef const _Tp* const_pointer;
151 typedef _Tp& reference;
152 typedef const _Tp& const_reference;
154 template<
typename _Tp1>
159 #if __cplusplus >= 201103L 165 _GLIBCXX20_DEPRECATED_SUGGEST(
"allocator_traits::is_always_equal")
178 #if __cplusplus >= 201103L 183 template<
typename _Tp1>
187 #if __cpp_constexpr_dynamic_alloc 192 #if __cplusplus > 201703L 193 [[nodiscard,__gnu__::__always_inline__]]
197 #ifdef __cpp_lib_is_constant_evaluated 198 if (std::is_constant_evaluated())
199 return static_cast<_Tp*
>(::operator
new(__n *
sizeof(_Tp)));
204 [[__gnu__::__always_inline__]]
206 deallocate(_Tp* __p,
size_t __n)
208 #ifdef __cpp_lib_is_constant_evaluated 209 if (std::is_constant_evaluated())
211 ::operator
delete(__p);
219 friend _GLIBCXX20_CONSTEXPR
bool 223 #if __cpp_impl_three_way_comparison < 201907L 224 friend _GLIBCXX20_CONSTEXPR
bool 232 template<
typename _T1,
typename _T2>
233 inline _GLIBCXX20_CONSTEXPR
bool 238 #if __cpp_impl_three_way_comparison < 201907L 239 template<
typename _T1,
typename _T2>
240 inline _GLIBCXX20_CONSTEXPR
bool 241 operator!=(
const allocator<_T1>&,
const allocator<_T2>&)
248 template<
typename _Tp>
249 class allocator<const _Tp>
252 typedef _Tp value_type;
253 template<
typename _Up> allocator(
const allocator<_Up>&) { }
256 template<
typename _Tp>
257 class allocator<volatile _Tp>
260 typedef _Tp value_type;
261 template<
typename _Up> allocator(
const allocator<_Up>&) { }
264 template<
typename _Tp>
265 class allocator<const volatile _Tp>
268 typedef _Tp value_type;
269 template<
typename _Up> allocator(
const allocator<_Up>&) { }
276 #if _GLIBCXX_EXTERN_TEMPLATE 277 extern template class allocator<char>;
278 extern template class allocator<wchar_t>;
282 #undef __allocator_base 285 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
287 {
static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
289 template<
typename _Alloc>
290 struct __alloc_swap<_Alloc, false>
293 _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
302 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
306 _S_do_it(
const _Alloc&,
const _Alloc&)
310 template<
typename _Alloc>
311 struct __alloc_neq<_Alloc, false>
314 _S_do_it(
const _Alloc& __one,
const _Alloc& __two)
315 {
return __one != __two; }
318 #if __cplusplus >= 201103L 319 template<
typename _Tp,
bool 320 = __or_<is_copy_constructible<typename _Tp::value_type>,
321 is_nothrow_move_constructible<typename _Tp::value_type>>::value>
322 struct __shrink_to_fit_aux
323 {
static bool _S_do_it(_Tp&) noexcept {
return false; } };
325 template<
typename _Tp>
326 struct __shrink_to_fit_aux<_Tp, true>
329 _S_do_it(_Tp& __c) noexcept
334 _Tp(__make_move_if_noexcept_iterator(__c.begin()),
335 __make_move_if_noexcept_iterator(__c.end()),
336 __c.get_allocator()).swap(__c);
348 _GLIBCXX_END_NAMESPACE_VERSION
An allocator that uses global new, as per C++03 [20.4.1].This is precisely the allocator defined in t...
The standard allocator, as per C++03 [20.4.1].
Uniform interface to all allocator types.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
ISO C++ entities toplevel namespace is std.