Go to the documentation of this file.
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__
STLAllocatorBase< T > Base
define our types, as per ISO C++
std::ptrdiff_t difference_type
const_pointer address(const_reference x) const
void construct(pointer p, const T &val)
STLAllocator(STLAllocator< U, P > const &)
cast
void construct(pointer p)
STLAllocator< U, AllocPolicy > other
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
Base::value_type value_type
STLAllocator(STLAllocator const &)
copy ctor - done component wise
const typedef value_type & const_reference
const typedef value_type * const_pointer
Wrapper class for operating as an STL container allocator.
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)
pointer address(reference x) const
size_type max_size() const
STLAllocator(STLAllocator< U, AllocPolicy > const &)
cast
virtual ~STLAllocator()
dtor
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15