Create an aligning allocator that guarantees the specified alignment.
Declared in <bdlma_aligningallocator.h>
explicit
AligningAllocator(
bsls::Types::size_type alignment,
bslma::Allocator* basicAllocator = 0);
Create an AligningAllocator object that guarantees alignment by the specified alignment (in bytes) of memory allocated. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0 or not supplied, the currently installed default allocator is used. The behavior is undefined unless alignment is a power of 2, and the alignment strategy of the allocator used to supply memory is BSLS_MAXIMUM or BSLS_NATURAL.
| Name | Description |
|---|---|
| alignment | required alignment of allocated memory |
| basicAllocator | memory allocator; null uses the default |