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
Public Types | Public Member Functions | List of all members
gko::copy_back_deleter< T > Class Template Reference

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...
 

Detailed Description

template<typename T>
class gko::copy_back_deleter< T >

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.

Template Parameters
Tthe type of object being deleted

Constructor & Destructor Documentation

◆ copy_back_deleter()

template<typename T >
gko::copy_back_deleter< T >::copy_back_deleter ( pointer  original)
inline

Creates a new deleter object.

Parameters
originalthe origin object where the data will be copied before deletion

Member Function Documentation

◆ operator()()

template<typename T >
void gko::copy_back_deleter< T >::operator() ( pointer  ptr) const
inline

Deletes the object.

Parameters
ptrpointer to the object being deleted

The documentation for this class was generated from the following file: