45 #define _ALLOCATOR_H 1
50 #ifdef __GXX_EXPERIMENTAL_CXX0X__
54 namespace std _GLIBCXX_VISIBILITY(default)
56 _GLIBCXX_BEGIN_NAMESPACE_VERSION
65 template<
typename _Tp>
73 typedef size_t size_type;
74 typedef ptrdiff_t difference_type;
75 typedef void* pointer;
76 typedef const void* const_pointer;
77 typedef void value_type;
79 template<
typename _Tp1>
91 template<
typename _Tp>
92 class allocator:
public __glibcxx_base_allocator<_Tp>
95 typedef size_t size_type;
96 typedef ptrdiff_t difference_type;
98 typedef const _Tp* const_pointer;
99 typedef _Tp& reference;
100 typedef const _Tp& const_reference;
101 typedef _Tp value_type;
103 template<
typename _Tp1>
107 allocator() throw() { }
109 allocator(
const allocator& __a)
throw()
110 : __glibcxx_base_allocator<_Tp>(__a) { }
112 template<
typename _Tp1>
113 allocator(
const allocator<_Tp1>&) throw() { }
115 ~allocator() throw() { }
120 template<
typename _T1,
typename _T2>
122 operator==(
const allocator<_T1>&,
const allocator<_T2>&)
125 template<
typename _Tp>
127 operator==(
const allocator<_Tp>&,
const allocator<_Tp>&)
130 template<
typename _T1,
typename _T2>
132 operator!=(
const allocator<_T1>&,
const allocator<_T2>&)
135 template<
typename _Tp>
137 operator!=(
const allocator<_Tp>&,
const allocator<_Tp>&)
142 #if _GLIBCXX_EXTERN_TEMPLATE
143 extern template class allocator<char>;
144 extern template class allocator<wchar_t>;
148 #undef __glibcxx_base_allocator
151 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
153 {
static void _S_do_it(_Alloc&, _Alloc&) { } };
155 template<
typename _Alloc>
156 struct __alloc_swap<_Alloc, false>
159 _S_do_it(_Alloc& __one, _Alloc& __two)
168 template<
typename _Alloc,
bool = __is_empty(_Alloc)>
172 _S_do_it(
const _Alloc&,
const _Alloc&)
176 template<
typename _Alloc>
177 struct __alloc_neq<_Alloc, false>
180 _S_do_it(
const _Alloc& __one,
const _Alloc& __two)
181 {
return __one != __two; }
184 #ifdef __GXX_EXPERIMENTAL_CXX0X__
191 template<
typename _Tp,
192 bool = __has_trivial_copy(
typename _Tp::value_type)>
193 struct __shrink_to_fit
194 {
static void _S_do_it(_Tp&) { } };
196 template<
typename _Tp>
197 struct __shrink_to_fit<_Tp, true>
203 { _Tp(__v).swap(__v); }
216 template<typename _Tp, typename _Alloc,
217 bool = __has_allocator_type<_Tp>::value>
218 struct __uses_allocator_helper
221 template<
typename _Tp,
typename _Alloc>
222 struct __uses_allocator_helper<_Tp, _Alloc, true>
223 :
public integral_constant<bool, is_convertible<_Alloc,
224 typename _Tp::allocator_type>::value>
228 template<
typename _Tp,
typename _Alloc>
231 __uses_allocator_helper<_Tp, _Alloc>::value>
236 _GLIBCXX_END_NAMESPACE_VERSION