C++11 added the ability to specify increased alignment (over-alignment) for
class types. Unfortunately,
and the default allocator,
do not support dynamic memory allocation of over-aligned data.
The align function can be used to align a
pointer and is provided for implementations which do not yet provide
The aligned_alloc function can be used in
new to specify the alignment of the
The aligned_allocator class template can be
used in place of
std::allocator as an alignment-aware default allocator.
The aligned_allocator_adaptor class template can be used to adapt any allocator into an alignment-aware allocator.
The aligned_delete class can be used in place
std::default_delete to destroy and free objects
The alignment_of type trait gets the alignment
of a type, and is provided for implementations without
The is_aligned function can be used to compare the alignment value of a pointer.