xenium
|
A small helper class for correctly aligned dynamic allocations of over-aligned types. More...
#include <aligned_object.hpp>
A small helper class for correctly aligned dynamic allocations of over-aligned types.
Dynamic allocation using the standard operator new
does not consider the alignment of the allocated type. To ensure that dynamic allocations are correctly aligned, classes can inherit from aligned_object
. If not specified explicitly, aligned_object
implicitly uses the alignment from std::alignment_of<Derived>()
.
Derived | |
Alignment | the alignment to use for dynamic allocations. If this value is 0, the alignment is derived from Derived . Defaults to 0. |