![]() |
Ginkgo
Generated from tags/v1.0.0^0 branch based on master. Ginkgo version 1.0.0
A numerical linear algebra library targeting many-core architectures
|
A copy_back_deleter is a type of deleter that copies the data to an internally referenced object before performing the deletion. More...
#include <ginkgo/core/base/utils.hpp>
Public Types | |
using | pointer = T * |
Public Member Functions | |
copy_back_deleter (pointer original) | |
Creates a new deleter object. More... | |
void | operator() (pointer ptr) const |
Deletes the object. More... | |
A copy_back_deleter is a type of deleter that copies the data to an internally referenced object before performing the deletion.
The deleter will use the copy_from
method to perform the copy, and then delete the passed object using the delete
keyword. This kind of deleter is useful when temporarily copying an object with the intent of copying it back once it goes out of scope.
There is also a specialization for constant objects that does not perform the copy, since a constant object couldn't have been changed.
T | the type of object being deleted |
|
inline |
Creates a new deleter object.
original | the origin object where the data will be copied before deletion |
|
inline |
Deletes the object.
ptr | pointer to the object being deleted |