CbmRoot
lit::parallel::DeleteObject Class Reference

Functor class for convenient memory release. More...

#include <LitUtils.h>

Public Member Functions

template<typename T >
void operator() (const T *ptr) const
 

Detailed Description

Functor class for convenient memory release.

For example if one has an std::vector<Hit*> of pointers to Hit objects. The hit objects where allocated with new operator than one can release memory with the following code: for_each(hits.begin(), hits.end(), DeleteObject());

Parameters
[in,out]parReference to track parameters.
[in]matReference to material

Definition at line 51 of file LitUtils.h.

Member Function Documentation

◆ operator()()

template<typename T >
void lit::parallel::DeleteObject::operator() ( const T *  ptr) const
inline

Definition at line 54 of file LitUtils.h.


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