yat
0.20.3pre
|
Functor that deletes an object. More...
#include <yat/utility/Deleter.h>
Public Member Functions | |
Deleter (bool active=true) | |
constructor More... | |
bool | active (void) const |
template<typename T > | |
void | operator() (T *ptr) const |
Functor that deletes an object.
The class is typically used as second argument to a std::shared_ptr, which enables to decide at runtime whether the shared_ptr should own the pointee, i.e., should the pointee be destructed at destruction of last shared_ptr pointing to the pointee.
theplu::yat::utility::Deleter::Deleter | ( | bool | active = true | ) |
constructor
active | decides whether functor will delete object or not. See operator(). |
bool theplu::yat::utility::Deleter::active | ( | void | ) | const |
|
inline |
Delete ptr if active() otherwise do nothing