OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ScopeGuard< T > Class Template Reference

#include <ScopeGuard.h>

Public Member Functions

 ScopeGuard (T &&callable)
 
 ~ScopeGuard ()
 

Private Attributes

_callable
 

Detailed Description

template<class T>
class ScopeGuard< T >

Scope guard to be used to roll back operations in an exception-safe way.

Example usage:

value = 10;
auto guard = ScopeGuard([&] { value = 1; });
Definition: ScopeGuard.h:17

Constructor & Destructor Documentation

◆ ScopeGuard()

template<class T >
ScopeGuard< T >::ScopeGuard ( T &&  callable)
inlineexplicit

◆ ~ScopeGuard()

template<class T >
ScopeGuard< T >::~ScopeGuard ( )
inline

Member Data Documentation

◆ _callable

template<class T >
T ScopeGuard< T >::_callable
private

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