A custom deleter that will delete an additional object, too. More...
#include <AdditionalObjectDeleter.hpp>
Public Member Functions | |
AdditionalObjectDeleter () | |
empty constructor. | |
AdditionalObjectDeleter (T &additional_object) | |
Constructor taking the object that needs to deleted. | |
template<class T1 > | |
void | operator() (T1 *pt) |
Delete an object and the additional one. |
A custom deleter that will delete an additional object, too.
In dune-istl most parallel preconditioners hold a reference to a sequential preconditioner. In CPRPreconditioner and NewtonIterationBlackoilInterleaved we use unique_ptr for the memory management. Ergo we need to construct the sequential preconditioner with new and make sure that it gets deleted together with the enclosing parallel preconditioner. Therefore this deleter stores a pointer to it and deletes it during destruction.
The | type of the additional object to be deleted. |