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 );
140 AllocPolicy::deallocateBytes(ptr);
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__
void construct(pointer p)
STLAllocator< U, AllocPolicy > other
the standard rebind mechanism
pointer allocate(size_type count, typename std::allocator< void >::const_pointer ptr=0)
memory allocation (elements, used by STL)
void deallocate(pointer ptr, size_type)
memory deallocation (elements, used by STL)
const_pointer address(const_reference x) const
virtual ~STLAllocator()
dtor
std::ptrdiff_t difference_type
pointer address(reference x) const
const value_type * const_pointer
STLAllocator(STLAllocator const &)
copy ctor - done component wise
void construct(pointer p, const T &val)
Wrapper class for operating as an STL container allocator.
STLAllocator(STLAllocator< U, P > const &)
cast
Base::value_type value_type
STLAllocator(STLAllocator< U, AllocPolicy > const &)
cast
STLAllocatorBase< T > Base
define our types, as per ISO C++
const value_type & const_reference
size_type max_size() const
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)