Encapsulates strategies for allocation and deallocation.
An Allocator must be a class type, and given
A
, an Allocator typesize
, a value of typesize_t
ptr
, a value of typevoid*
, obtained by callingA::allocate
the following expressions must be valid and have their specified effects:
Expression | Return type | Requirements |
---|---|---|
A::allocate(size) |
void* |
Allocates size bytes of uninitialized storage space and returns a pointer to the storage space. |
A::deallocate(ptr) |
(not used) | Deallocates storage space pointed by ptr, which is earlier obtained from allocate . |