#include <utils.h>
Public Member Functions | |
| local_value (T &_variable, const T &_value) | |
| The only allowed constructor. | |
| ~local_value () | |
| The destructor which restores the original value of the variable. | |
Private Attributes | |
| T & | variable |
| A reference of the variable. | |
| T | previous_value |
| The original value of the variable. | |
The restoration of the previous value takes place upon destruction of this object. This action effects in a local value of a given variable valid in the current block only (e.g., until 'return').
Definition at line 79 of file utils.h.
| local_value< T >::local_value | ( | T & | _variable, | |
| const T & | _value | |||
| ) | [inline] |
The only allowed constructor.
Definition at line 83 of file utils.h.
References local_value< T >::variable.
| local_value< T >::~local_value | ( | ) | [inline] |
The destructor which restores the original value of the variable.
Definition at line 88 of file utils.h.
References local_value< T >::previous_value, and local_value< T >::variable.
T& local_value< T >::variable [private] |
A reference of the variable.
Definition at line 92 of file utils.h.
Referenced by local_value< T >::local_value(), and local_value< T >::~local_value().
T local_value< T >::previous_value [private] |
The original value of the variable.
Definition at line 95 of file utils.h.
Referenced by local_value< T >::~local_value().
1.5.3