|
Dev Essential
1.6.3
|
#include <stack_ptr_decl.h>
Public Member Functions | |
| StackPtr () | |
Initializes the storage and constructs object ot type T by calling its default ctor. | |
| StackPtr (std::nullptr_t) | |
Constructor overload t zero-initialize the storage - no object of type T is constructed! | |
| StackPtr (const T &data) | |
| StackPtr (T &&data) | |
| ~StackPtr () | |
| Destructor. | |
| StackPtr (const StackPtr &other) | |
| StackPtr & | operator= (StackPtr other) |
| StackPtr (StackPtr &&other) | |
| T * | operator-> () |
| const T * | operator-> () const |
| T & | operator* () |
| const T & | operator* () const |
| operator bool () const noexcept | |
| void | reset () |
| Unitializes the storage and, if constructed, destructs the storaged object. | |
| template<typename... Args> | |
| void | reset (Args &&... args) |
| void | swap (StackPtr &other) |
Friends | |
| template<typename U, std::size_t SSize, std::size_t A> | |
| bool | operator== (const StackPtr< U, SSize, A > &lhs, const StackPtr< U, SSize, A > &rhs) |
A smart pointer allocating its memory only on the stack
| T | The storaged type - must be default and move constructible |
| StackSize | Size of the stack to allocate - must at least be the sizeof the object of type T. |
| Alignment | Alignment of the storage |
|
inline |
Initializes the storage by calling the copy constructor of type T
| [in] | data | Object of type T whose content gets copy constructed into the storage |
|
inline |
Initializes the storage by moving data to internal memory representation.
| [in] | data | Object of type T that gets moved into the storage |
|
inline |
Copy constructor
| [in] | other | Object of type StackPtr whose content gets copy constructed into the storage only if the object inside its storage was constructed |
|
inline |
Move constructor
| [in,out] | other | Move-from object, left in a valid but unspecified state |
|
inlineexplicitnoexcept |
Check whether *this owns an object
true if *this owns an object, false otherwise
|
inline |
Operator overload to use this class like a raw pointer
T
|
inline |
Operator overload to use this class like a raw pointer - for const correctness
T
|
inline |
Operator overload to use this class like a raw pointer
T
|
inline |
Operator overload to use this class like a raw pointer - for const correctness
T
|
inline |
Assignment operator
| [in] | other | Object of type StackPtr whose content gets copy constructed into the storage only if the object inside its storage was constructed |
|
inline |
Resets the managed object of type T by forwarding args to its ctor
| Args | Argument types of type T ctor |
| [in] | args | Arguments passed to the ctor of type T for its construction |
|
inline |
Swap storage of *this with storage of other stack pointer
| [in] | other | Object of type StackPtr whose content gets swapped with *this |
|
friend |
Compare for equality
| U | Managed type |
| SSize | Size the managed type occupies |
| A | Byte alignment of the storage |
| [in] | lhs | Left hand side object |
| [in] | rhs | Right hand side object |
true if both objects are equal, false otherwise