Templated helper that reserves memory of size and alignment corresponding to type T. Along with that, construction, destruction and reinterpretation casts are given in various ways.
The type is used for class members or (less frequently for local variables), whose construction has to be deferred.
T | The type to replace. |
Definition at line 20 of file lang/placeholder.inl.
Public Field Index: | |
char | bytes [sizeof(T)] |
the placeholder space. | |
Public Method Index: | |
template<typename... TArgs> | |
void | Construct (TArgs &&... args) |
void | Destruct () |
Destructs the custom type T represented by this placeholder. | |
T * | Get () |
const T * | Get () const |
T & | operator* () |
const T & | operator* () const |
T * | operator-> () |
const T * | operator-> () const |
char alib::lang::Placeholder< T >::bytes[sizeof(T)] |
the placeholder space.
Definition at line 23 of file lang/placeholder.inl.
|
inline |
Constructs the custom type T represented by this placeholder.
TArgs | The argument types used for constructing T. |
args | The arguments to construct the instance of T. |
Definition at line 29 of file lang/placeholder.inl.
|
inline |
Destructs the custom type T represented by this placeholder.
Definition at line 32 of file lang/placeholder.inl.
|
inline |
Returns a non-constant pointer to the represented instance of type T.
Definition at line 36 of file lang/placeholder.inl.
|
inline |
Returns a constant pointer to the represented instance of type T.
Definition at line 40 of file lang/placeholder.inl.
|
inline |
Overloaded operator to access the represented instance of type T.
Definition at line 52 of file lang/placeholder.inl.
|
inline |
Overloaded operator to access the represented instance of type T.
Definition at line 56 of file lang/placeholder.inl.
|
inline |
Overloaded operator to access the represented instance of type T.
Definition at line 44 of file lang/placeholder.inl.
|
inline |
Overloaded operator to access the represented instance of type T.
Definition at line 48 of file lang/placeholder.inl.