The destructor class provides a destructor for registered types.
More...
#include <destructor.h>
The destructor class provides a destructor for registered types.
A instance of a destructor class can only be obtained from the type class. See type::get_destructor().
Copying and Assignment
A destructor object is lightweight and can be copied by value. However, each copy will refer to the same underlying destructor.
Typical Usage
variant my_string = string_ctor.
invoke(
"Hello World");
my_string.is_valid();
- See also
- method, property, enumeration, constructor and type
type rttr::destructor::get_declaring_type |
( |
| ) |
const |
|
noexcept |
Returns the class that declares this destructor.
- Returns
- Type of the declaring class/struct for this destructor.
type rttr::destructor::get_destructed_type |
( |
| ) |
const |
|
noexcept |
Returns the rttr::type for which this destructor can delete objects.
- Returns
- The type of this destructor.
bool rttr::destructor::invoke |
( |
variant & |
obj | ) |
const |
|
noexcept |
Destroys the contained object in the variant obj
.
- Returns
- True if the destructor of the object could be invoked, otherwise false.
bool rttr::destructor::is_valid |
( |
| ) |
const |
|
noexcept |
Returns true whether this destructor object is valid; otherwise false.
- Returns
- Returns true when the destructor is valid; otherwise false.
rttr::destructor::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Convenience function to check if this destructor is valid or not.
- Returns
- True if this destructor is valid, otherwise false.
bool rttr::destructor::operator!= |
( |
const destructor & |
other | ) |
const |
|
noexcept |
Returns true if this destructor is the not the same like the other
.
- Returns
- True if both destructors are different, otherwise false.
bool rttr::destructor::operator== |
( |
const destructor & |
other | ) |
const |
|
noexcept |
Returns true if this destructor is the same like the other
.
- Returns
- True if both destructors are equal, otherwise false.
The documentation for this class was generated from the following file: