A wrapper around std::aligned_storage< _LEN_, _ALIGN_ >::type
that simplifies initializing the provided storage space, getting from it, setting it to, and automatic destroying it from objects of any type fitting to the given size and alignment requirements.
More...
#include "utility.hpp"
Public Member Functions | |
aligned_storage ()=default | |
Create an uninitialized storage. | |
aligned_storage (const aligned_storage &)=delete | |
aligned_storage & | operator= (const aligned_storage &)=delete |
aligned_storage (aligned_storage &&)=delete | |
aligned_storage & | operator= (aligned_storage &&)=delete |
template<typename _T_ > | |
aligned_storage (const _T_ &_value) | |
Create a storage space with a copy-initialized value from the specified one. | |
template<typename _T_ > | |
aligned_storage (_T_ &&_value) | |
Create a storage space with a move-initialized value from the specified value. | |
const std::type_info * | tag () const noexcept |
The type tag of the stored value. More... | |
operator bool () const noexcept | |
Equivalent to (tag() != nullptr) . | |
Functions to reinitialize the storage space: | |
| |
template<typename _T_ > | |
void | reset () |
Reinitialize the storage space with a default value of the specified type. | |
template<typename _T_ , typename... _Args_> | |
void | reset (_Args_ &&... _args) |
Ditto but the value is created from the arguments forwarded to the type constructor. | |
template<typename _T_ > | |
void | reset (const _T_ &_value) |
Ditto but the value is copy-created from the specified argument. | |
template<typename _T_ > | |
void | reset (_T_ &&_value) |
Ditto but the value is move-created from the specified argument. | |
Functions to get the value that this storage space is holding: | |
template<typename _T_ > | |
const std::decay< _T_ >::type & | get () const noexcept |
template<typename _T_ > | |
std::decay< _T_ >::type & | get () noexcept |
A wrapper around std::aligned_storage< _LEN_, _ALIGN_ >::type
that simplifies initializing the provided storage space, getting from it, setting it to, and automatic destroying it from objects of any type fitting to the given size and alignment requirements.
Definition at line 339 of file utility.hpp.
|
inlinenoexcept |
The type tag of the stored value.
It's just a pointer referring to the static global constant object returned by the typeid()
operator for the type of the value currently stored in this variable. nullptr
is returned if the storage space is not initialized and is not holding any value.
Definition at line 463 of file utility.hpp.