Finalizer class to help with exception safety sets variable to value on destruction. More...
#include <utility.hpp>
Public Member Functions | |
variable_finalizer (T &variable, T value) | |
~variable_finalizer () | |
void | clear () |
Stop tracking the variable, i.e. More... | |
Private Attributes | |
T * | variable_ |
T | value_ |
Finalizer class to help with exception safety sets variable to value on destruction.
Definition at line 81 of file utility.hpp.
|
inline |
Definition at line 84 of file utility.hpp.
|
inline |
Definition at line 88 of file utility.hpp.
References wb::variable_finalizer< T >::value_, and wb::variable_finalizer< T >::variable_.
|
inline |
Stop tracking the variable, i.e.
this object won't do anything on destruction.
Definition at line 95 of file utility.hpp.
References wb::variable_finalizer< T >::variable_.
|
private |
Definition at line 101 of file utility.hpp.
Referenced by wb::variable_finalizer< T >::~variable_finalizer().
|
private |
Definition at line 100 of file utility.hpp.
Referenced by wb::variable_finalizer< T >::clear(), and wb::variable_finalizer< T >::~variable_finalizer().