opm-simulators
genericguard.hh File Reference

A simple class which makes sure that a cleanup function is called once the object is destroyed. More...

Go to the source code of this file.

Classes

class  Opm::GenericGuard< Callback >
 A simple class which makes sure that a cleanup function is called once the object is destroyed. More...
 

Namespaces

 Opm
 Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that both can include.
 

Functions

template<class Callback >
GenericGuard< Callback > Opm::make_guard (Callback &callback)
 

Detailed Description

A simple class which makes sure that a cleanup function is called once the object is destroyed.

This class is particularly useful in conjunction with lambdas for code that might throw exceptions.