36 #ifndef _EXTPTR_ALLOCATOR_H
37 #define _EXTPTR_ALLOCATOR_H 1
43 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
45 _GLIBCXX_BEGIN_NAMESPACE_VERSION
55 template<
typename _Tp>
59 typedef std::size_t size_type;
60 typedef std::ptrdiff_t difference_type;
67 typedef _Tp& reference;
68 typedef const _Tp& const_reference;
69 typedef _Tp value_type;
71 template<
typename _Up>
79 : _M_real_alloc(__rarg._M_real_alloc) { }
81 template<
typename _Up>
83 : _M_real_alloc(__rarg._M_getUnderlyingImp()) { }
88 pointer address(reference __x)
const
89 {
return std::__addressof(__x); }
92 {
return std::__addressof(__x); }
94 pointer allocate(size_type __n,
void* __hint = 0)
95 {
return _M_real_alloc.allocate(__n,__hint); }
97 void deallocate(
pointer __p, size_type __n)
98 { _M_real_alloc.deallocate(__p.get(), __n); }
100 size_type max_size()
const throw()
103 void construct(
pointer __p,
const _Tp& __val)
104 { ::new(__p.get()) _Tp(__val); }
106 #ifdef __GXX_EXPERIMENTAL_CXX0X__
107 template<
typename... _Args>
109 construct(
pointer __p, _Args&&... __args)
110 { ::new(__p.get()) _Tp(std::forward<_Args>(__args)...); }
116 template<
typename _Up>
119 {
return _M_real_alloc == __rarg._M_getUnderlyingImp(); }
123 {
return _M_real_alloc == __rarg._M_real_alloc; }
125 template<
typename _Up>
128 {
return _M_real_alloc != __rarg._M_getUnderlyingImp(); }
132 {
return _M_real_alloc != __rarg._M_real_alloc; }
134 template<
typename _Up>
140 _M_getUnderlyingImp()
const
141 {
return _M_real_alloc; }
152 typedef std::size_t size_type;
153 typedef std::ptrdiff_t difference_type;
154 typedef void value_type;
161 template<
typename _Up>
169 template<
typename _Tp>
171 swap(_ExtPtr_allocator<_Tp>& __larg, _ExtPtr_allocator<_Tp>& __rarg)
174 __rarg._M_real_alloc = __larg._M_real_alloc;
175 __larg._M_real_alloc = __tmp;
178 _GLIBCXX_END_NAMESPACE_VERSION
An example allocator which uses a non-standard pointer type.This allocator specifies that containers ...
static constexpr _Tp max()
allocator<void> specialization.
The standard allocator, as per [20.4].Further details: http://gcc.gnu.org/onlinedocs/libstdc++/manual...