Simple object for writing RAII-like scoped states (see example).
More...
|
| | ScopedState (Ref< TState > store, TState scopedState) |
| | Ctor.
|
| |
|
void | Dispose () |
| | Cleanup - restore the flag's original value.
|
| |
Simple object for writing RAII-like scoped states (see example).
bool flag = false;
...
{
}
ScopedState(Ref< TState > store, TState scopedState)
Ctor.
Definition ScopedState.cs:30
- Template Parameters
-
| TState | Must be a value type. |
◆ ScopedState()
| ScopedState |
( |
Ref< TState > | store, |
|
|
TState | scopedState ) |
Ctor.
- Parameters
-
| store | Reference to the value type that contains the flag to be altered in the scope. |
| scopedState | State the flag should assume inside the scope. |