E-MailRelay
Public Member Functions | List of all members
G::ScopeExitSet< T, Value > Class Template Reference

A class that sets a simple variable to a particular value at the end of its scope. More...

#include <gscope.h>

Public Member Functions

 ScopeExitSet (T &ref) noexcept
 Constructor. More...
 
 ~ScopeExitSet () noexcept
 Destructor, sets the bound value. More...
 
void release () noexcept
 Deactivates the exit function. More...
 
 ScopeExitSet (const ScopeExitSet &)=delete
 
 ScopeExitSet (ScopeExitSet &&)=delete
 
ScopeExitSetoperator= (const ScopeExitSet &)=delete
 
ScopeExitSetoperator= (ScopeExitSet &&)=delete
 

Detailed Description

template<typename T, T Value>
class G::ScopeExitSet< T, Value >

A class that sets a simple variable to a particular value at the end of its scope.

Eg:

{
ScopeExitSet<bool,false> _( m_busy = true ) ;
...
}

Definition at line 81 of file gscope.h.

Constructor & Destructor Documentation

◆ ScopeExitSet()

template<typename T , T Value>
G::ScopeExitSet< T, Value >::ScopeExitSet ( T &  ref)
explicitnoexcept

Constructor.

Definition at line 129 of file gscope.h.

◆ ~ScopeExitSet()

template<typename T , T Value>
G::ScopeExitSet< T, Value >::~ScopeExitSet
noexcept

Destructor, sets the bound value.

Definition at line 143 of file gscope.h.

Member Function Documentation

◆ release()

template<typename T , T Value>
void G::ScopeExitSet< T, Value >::release
noexcept

Deactivates the exit function.

Definition at line 135 of file gscope.h.


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