29 #ifndef _MemorySTLAllocator_H__ 30 #define _MemorySTLAllocator_H__ 115 template <
typename U>
120 template <
typename U,
typename P>
126 typename std::allocator<void>::const_pointer ptr = 0 )
130 register size_type sz = count*
sizeof( T );
131 pointer p =
static_cast<pointer
>(AllocPolicy::allocateBytes(sz));
140 AllocPolicy::deallocateBytes(ptr);
148 const_pointer
address(const_reference x)
const 156 return AllocPolicy::getMaxAllocationSize();
159 #if __cplusplus < 201103L 163 new(
static_cast<void*
>(p)) T();
170 new(
static_cast<void*
>(p)) T(val);
183 template<
typename T,
typename T2,
typename P>
193 template<
typename T,
typename P,
typename OtherAllocator>
195 OtherAllocator
const&)
201 template<
typename T,
typename T2,
typename P>
211 template<
typename T,
typename P,
typename OtherAllocator>
213 OtherAllocator
const&)
227 #endif // _MemorySTLAllocator_H__ STLAllocatorBase< T > Base
define our types, as per ISO C++
const_pointer address(const_reference x) const
Wrapper class for operating as an STL container allocator.
the standard rebind mechanism
std::ptrdiff_t difference_type
void construct(pointer p)
void construct(pointer p, const T &val)
Base::value_type value_type
STLAllocator< U, AllocPolicy > other
STLAllocator(STLAllocator< U, P > const &)
cast
STLAllocator(STLAllocator const &)
copy ctor - done component wise
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
const value_type * const_pointer
const value_type & const_reference
void deallocate(pointer ptr, size_type)
memory deallocation (elements, used by STL)
pointer allocate(size_type count, typename std::allocator< void >::const_pointer ptr=0)
memory allocation (elements, used by STL)
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
STLAllocator(STLAllocator< U, AllocPolicy > const &)
cast
virtual ~STLAllocator()
dtor
pointer address(reference x) const
size_type max_size() const