|
SIRIUS 7.5.0
Electronic structure library and applications
|
Handle deallocation of a poiniter to an object of any type. More...
#include <any_ptr.hpp>
Public Member Functions | |
| template<typename T > | |
| any_ptr (T *ptr__) | |
| Constructor. More... | |
| ~any_ptr () | |
| Destructor. More... | |
| template<typename T > | |
| T & | get () const |
| Cast pointer to a given type and return a reference. More... | |
Private Attributes | |
| void * | ptr_ |
| Untyped pointer to a stored object. More... | |
| std::function< void(void *)> | deleter_ |
| Deleter for the stored object. More... | |
Handle deallocation of a poiniter to an object of any type.
Example:
And the output is:
in Foo() constructor the number is: 42 in Foo() destructor
Definition at line 73 of file any_ptr.hpp.
|
inline |
Constructor.
Definition at line 84 of file any_ptr.hpp.
|
inline |
Destructor.
Definition at line 90 of file any_ptr.hpp.
|
inline |
Cast pointer to a given type and return a reference.
Definition at line 96 of file any_ptr.hpp.
|
private |
Untyped pointer to a stored object.
Definition at line 77 of file any_ptr.hpp.
|
private |
Deleter for the stored object.
Definition at line 79 of file any_ptr.hpp.