44 #define _ALLOCATOR_H 1 48 #if __cplusplus >= 201103L 52 #define __cpp_lib_incomplete_container_elements 201505 53 #if __cplusplus >= 201103L 54 # define __cpp_lib_allocator_is_always_equal 201411 57 namespace std _GLIBCXX_VISIBILITY(default)
59 _GLIBCXX_BEGIN_NAMESPACE_VERSION
71 typedef size_t size_type;
72 typedef ptrdiff_t difference_type;
73 typedef void* pointer;
74 typedef const void* const_pointer;
75 typedef void value_type;
77 template<
typename _Tp1>
81 #if __cplusplus >= 201103L 88 template<
typename _Up,
typename... _Args>
90 construct(_Up* __p, _Args&&... __args)
91 { ::new((
void *)__p) _Up(std::forward<_Args>(__args)...); }
93 template<
typename _Up>
95 destroy(_Up* __p) { __p->~_Up(); }
107 template<
typename _Tp>
111 typedef size_t size_type;
112 typedef ptrdiff_t difference_type;
113 typedef _Tp* pointer;
114 typedef const _Tp* const_pointer;
115 typedef _Tp& reference;
116 typedef const _Tp& const_reference;
117 typedef _Tp value_type;
119 template<
typename _Tp1>
123 #if __cplusplus >= 201103L 136 template<
typename _Tp1>
144 template<
typename _T1,
typename _T2>
147 _GLIBCXX_USE_NOEXCEPT
150 template<
typename _Tp>
152 operator==(
const allocator<_Tp>&,
const allocator<_Tp>&)
153 _GLIBCXX_USE_NOEXCEPT
156 template<
typename _T1,
typename _T2>
158 operator!=(
const allocator<_T1>&,
const allocator<_T2>&)
159 _GLIBCXX_USE_NOEXCEPT
162 template<
typename _Tp>
164 operator!=(
const allocator<_Tp>&,
const allocator<_Tp>&)
165 _GLIBCXX_USE_NOEXCEPT
170 template<
typename _Tp>
171 class allocator<const _Tp>
174 typedef _Tp value_type;
175 template<
typename _Up> allocator(
const allocator<_Up>&) { }
178 template<
typename _Tp>
179 class allocator<volatile _Tp>
182 typedef _Tp value_type;
183 template<
typename _Up> allocator(
const allocator<_Up>&) { }
186 template<
typename _Tp>
187 class allocator<const volatile _Tp>
190 typedef _Tp value_type;
191 template<
typename _Up> allocator(
const allocator<_Up>&) { }
198 #if _GLIBCXX_EXTERN_TEMPLATE 199 extern template class allocator<char>;
200 extern template class allocator<wchar_t>;
204 #undef __allocator_base 207 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
209 {
static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
211 template<
typename _Alloc>
212 struct __alloc_swap<_Alloc, false>
215 _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
224 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
228 _S_do_it(
const _Alloc&,
const _Alloc&)
232 template<
typename _Alloc>
233 struct __alloc_neq<_Alloc, false>
236 _S_do_it(
const _Alloc& __one,
const _Alloc& __two)
237 {
return __one != __two; }
240 #if __cplusplus >= 201103L 241 template<
typename _Tp,
bool 242 = __or_<is_copy_constructible<typename _Tp::value_type>,
243 is_nothrow_move_constructible<typename _Tp::value_type>>::value>
244 struct __shrink_to_fit_aux
245 {
static bool _S_do_it(_Tp&) noexcept {
return false; } };
247 template<
typename _Tp>
248 struct __shrink_to_fit_aux<_Tp, true>
251 _S_do_it(_Tp& __c) noexcept
256 _Tp(__make_move_if_noexcept_iterator(__c.begin()),
257 __make_move_if_noexcept_iterator(__c.end()),
258 __c.get_allocator()).swap(__c);
270 _GLIBCXX_END_NAMESPACE_VERSION
The standard allocator, as per [20.4].
ISO C++ entities toplevel namespace is std.
An allocator that uses global new, as per [20.4].This is precisely the allocator defined in the C++ S...