35 #ifndef MADNESS_WORLD_DEFERRED_DELETER_H__INCLUDED
36 #define MADNESS_WORLD_DEFERRED_DELETER_H__INCLUDED
60 template <
typename ptrT,
typename deleterT =
void(*)(ptrT*)>
61 class DeferredDeleter {
72 static typename enable_if<std::is_same<D, void(*)(ptrT*)>, D>::type
90 deferred_(detail::DeferredCleanup::get_deferred_cleanup(w)), deleter_(d)
97 deferred_(other.deferred_), deleter_(other.deleter_)
105 deferred_ = other.deferred_;
106 deleter_ = other.deleter_;
118 deferred_->
add(std::static_pointer_cast<void>(temp));
136 template <
typename ptrT,
typename deleterT>
149 template <
typename ptrT>
156 #endif // MADNESS_WORLD_DEFERRED_DELETER_H__INCLUDED
Deferred deleter for smart pointers.
Definition: deferred_cleanup.h:46
DeferredDeleter(World &w, deleterT d=default_deleter< deleterT >())
Constructs a deferred deleter object.
Definition: deferred_deleter.h:89
Grossly simplified Boost-like type traits and templates.
static enable_if< std::is_same< D, void(*)(ptrT *)>, D >::type default_deleter()
Construct a default deleter for a function pointer.
Definition: deferred_deleter.h:73
disable_if from Boost for conditionally instantiating templates based on type
Definition: enable_if.h:78
DeferredDeleter< ptrT, deleterT > make_deferred_deleter(World &w, deleterT d)
Make a defered deleter object for use with std::shared_ptr.
Definition: deferred_deleter.h:137
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
void add(const void_ptr &obj)
Adds item to cleanup list.
Definition: deferred_cleanup.cc:54
DeferredDeleter(const DeferredDeleter< ptrT, deleterT > &other)
Copy constructor.
Definition: deferred_deleter.h:96
void operator()(ptrT *p) const
The deferred deletion function.
Definition: deferred_deleter.h:115
static disable_if< std::is_same< D, void(*)(ptrT *)>, D >::type default_deleter()
Construct a default deleter for a functor.
Definition: deferred_deleter.h:78
DeferredDeleter< ptrT, deleterT > & operator=(const DeferredDeleter< ptrT, deleterT > &other)
Copy assignment operator.
Definition: deferred_deleter.h:104
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45