table of contents
std::aligned_storage< _Len, _Align >(3cxx) | std::aligned_storage< _Len, _Align >(3cxx) |
NAME¶
std::aligned_storage< _Len, _Align > - Aligned storage.
SYNOPSIS¶
#include <type_traits>
Detailed Description¶
template<size_t _Len, size_t _Align = __aligned_storage_default_alignment(_Len)>¶
struct std::aligned_storage< _Len, _Align >"Aligned storage.
The member typedef type is be a POD type suitable for use as uninitialized storage for any object whose size is at most _Len and whose alignment is a divisor of _Align.
It is important to use the nested type as uninitialized storage, not the std::aligned_storage type itself which is an empty class with 1-byte alignment. So this is correct:
typename std::aligned_storage<sizeof(X), alignof(X)>::type m_xobj;
This is wrong:
std::aligned_storage<sizeof(X), alignof(X)> m_xobj;
In C++14 and later std::aligned_storage_t<sizeof(X), alignof(X)> can be used to refer to the type member typedef.
The default value of _Align is supposed to be the most stringent fundamental alignment requirement for any C++ object type whose size is no greater than _Len (see [basic.align] in the C++ standard).
Deprecated
Author¶
Generated automatically by Doxygen for libstdc++ from the source code.
libstdc++ |