The destructor class provides a destructor for registered types. More...
#include <destructor.h>
Public Member Functions | |
type | get_destructed_type () const |
Returns the rttr::type for which this destructor can delete objects. More... | |
void | invoke (variant &obj) const |
Destroys the given object obj . More... | |
bool | is_valid () const |
Returns true whether this destructor object is valid; otherwise false. More... | |
operator bool () const | |
Convenience function to check if this destructor is valid or not. More... | |
bool | operator!= (const destructor &other) const |
Returns true if this destructor is the not the same like the other . More... | |
bool | operator== (const destructor &other) const |
Returns true if this destructor is the same like the other . More... | |
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().
A destructor object is lightweight and can be copied by value. However, each copy will refer to the same underlying destructor.
type rttr::destructor::get_destructed_type | ( | ) | const |
Returns the rttr::type for which this destructor can delete objects.
void rttr::destructor::invoke | ( | variant & | obj | ) | const |
Destroys the given object obj
.
obj
could be destroyed the given obj
is invalid after calling this method; Otherwise it is still valid. bool rttr::destructor::is_valid | ( | ) | const |
Returns true whether this destructor object is valid; otherwise false.
rttr::destructor::operator bool | ( | ) | const |
Convenience function to check if this destructor is valid or not.
bool rttr::destructor::operator!= | ( | const destructor & | other | ) | const |
Returns true if this destructor is the not the same like the other
.
bool rttr::destructor::operator== | ( | const destructor & | other | ) | const |
Returns true if this destructor is the same like the other
.