Utilities - T_VarStorage< Type >
A type that allocates storage for a value of a given type.
This commit is contained in:
parent
b8db177012
commit
a22cca26e2
1 changed files with 9 additions and 0 deletions
|
@ -229,6 +229,15 @@ template< typename T >
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// T_VarStorage< DataType > - A storage buffer with the correct size and
|
||||||
|
// alignment for the specified data type.
|
||||||
|
template< typename DataType >
|
||||||
|
using T_VarStorage = typename std::aligned_storage<
|
||||||
|
sizeof( DataType ) , alignof( DataType )
|
||||||
|
>::type;
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Define a structure that can be used as a tag
|
// Define a structure that can be used as a tag
|
||||||
#define M_DEFINE_TAG( NAME ) \
|
#define M_DEFINE_TAG( NAME ) \
|
||||||
struct NAME { }
|
struct NAME { }
|
||||||
|
|
Loading…
Reference in a new issue