![]() |
POD data type with a fixed alignment.The AlignedStorage class template represents a POD data type with a fixed alignment. Via this class it is possible to enforce a specific, type-based alignment for static data types. The required alignment is evaluated based on the given data type T. In case T is a built-in, vectorizable data type, AlignedStorage enforces an alignment of 16 or 32 bytes, depending on the active SSE/AVX level. In all other cases, no specific alignment is enforced. More...
#include <AlignedStorage.h>
Inherits AlignedStorageHelper< AlignmentTrait< T >::value >.
POD data type with a fixed alignment.
The AlignedStorage class template represents a POD data type with a fixed alignment. Via this class it is possible to enforce a specific, type-based alignment for static data types. The required alignment is evaluated based on the given data type T. In case T is a built-in, vectorizable data type, AlignedStorage enforces an alignment of 16 or 32 bytes, depending on the active SSE/AVX level. In all other cases, no specific alignment is enforced.
In the following code example, the StaticVector class, representing a vector of N statically allocated elements, is non-publicly deriving from the AlignedStorage class template. By this, the N data elements of type T are aligned according to the requirements of T.