Temporarily sets a boolean flag and restores it automatically. More...
#include <WithFlag.h>
Collaboration diagram for WithFlag:Public Member Functions | |
| WithFlag (bool &flag, bool value=true) | |
| Construct the WithFlag and set the flag to the desired value (default true). | |
| ~WithFlag () | |
| Destructor restores the original value of the flag. | |
Private Attributes | |
| bool & | flag |
| bool | previousValue |
Definition at line 21 of file WithFlag.h.
|
inlineexplicit |
| flag | Reference to the flag to modify. |
| value | The value to temporarily set (default: true). |
Definition at line 31 of file WithFlag.h.
References flag.
|
inline |
Definition at line 39 of file WithFlag.h.
References flag, and previousValue.
|
private |
Definition at line 22 of file WithFlag.h.
Referenced by WithFlag(), and ~WithFlag().
|
private |
Definition at line 23 of file WithFlag.h.
Referenced by ~WithFlag().