SPH
|
Simple block of memory on stack with size and alignment given by template type. More...
#include <AlignedStorage.h>
Public Member Functions | |
AlignedStorage ()=default | |
template<typename... TArgs> | |
INLINE void | emplace (TArgs &&... rest) |
INLINE void | destroy () |
constexpr INLINE | operator Type & () noexcept |
Implicit conversion to stored type. More... | |
constexpr INLINE | operator const Type & () const noexcept |
Implicit conversion to stored type, const version. More... | |
constexpr INLINE Type & | get () noexcept |
Return the reference to the stored value. More... | |
constexpr INLINE const Type & | get () const noexcept |
Returns the reference to the stored value, const version. More... | |
Simple block of memory on stack with size and alignment given by template type.
AlignedStorage can be used to construct an object on stack while sidestepping default construction. Objects can be therefore default-constructed even if the underlying type does not have default constructor. Stored object can be later constructed by calling emplace method. Note that when constructed, it has to be later destroyed by explicitly calling destroy method, this is not done automatically! This object does NO checks when the stored value is accessed, or whether it is constructed multiple times. This is left to the user.
Definition at line 56 of file AlignedStorage.h.
|
default |
|
inline |
Definition at line 70 of file AlignedStorage.h.
|
inline |
Definition at line 66 of file AlignedStorage.h.
|
inlineconstexprnoexcept |
Returns the reference to the stored value, const version.
Definition at line 90 of file AlignedStorage.h.
|
inlineconstexprnoexcept |
Return the reference to the stored value.
Definition at line 85 of file AlignedStorage.h.
|
inlineconstexprnoexcept |
Implicit conversion to stored type, const version.
Definition at line 80 of file AlignedStorage.h.
|
inlineconstexprnoexcept |
Implicit conversion to stored type.
Definition at line 75 of file AlignedStorage.h.