![]() |
Home | Libraries | People | FAQ | More |
boost::mpi::allocator<void> — Allocator specialization for void value types.
// In header: <boost/mpi/allocator.hpp> class allocator<void> { public: // types typedef void * pointer; typedef const void * const_pointer; typedef void value_type; typedef std::size_t size_type; // Holds the size of objects. typedef std::ptrdiff_t difference_type; // Holds the number of elements between two pointers. typedef void & reference; // A reference to an object of typeT. typedef const void & const_reference; // A reference to a constant object of typeT. // member classes/structs/unions struct rebind { // types typedef allocator< U > other; }; // public member functions allocator(); ~allocator(); pointer address(reference) const; pointer allocate(size_type, allocator< void >::const_pointer = 0); void deallocate(pointer, size_type); size_type max_size() const; void construct(pointer, const void &); void destroy(pointer); };
The void specialization of allocator is useful only for rebinding to another, different value type.
allocator public member functionsallocator();
Default-construct an allocator.
~allocator();
Destroy an allocator.
pointer address(reference x) const;
Returns the address of object x.
pointer allocate(size_type n, allocator< void >::const_pointer = 0);
Allocate enough memory for n elements of type T.
Parameters: |
|
||
Returns: |
a pointer to the newly-allocated memory |
void deallocate(pointer p, size_type);
Deallocate memory referred to by the pointer p.
Parameters: |
|
size_type max_size() const;
Returns the maximum number of elements that can be allocated with allocate().
void construct(pointer p, const void & val);
Construct a copy of val at the location referenced by p.
void destroy(pointer p);
Destroy the object referenced by p.