Simple object for writing RAII-like scoped states (see example).
More...
Inherits IDisposable.
|
| | ScopedState (Ref< TState > store, TState scopedState) |
| | Ctor. More...
|
| |
|
void | Dispose () |
| | Cleanup - restore the flag's original value.
|
| |
Simple object for writing RAII-like scoped states (see example).
bool flag = false;
...
{
}
Class to store a reference to a value type in.
Definition: Ref.cs:10
Simple object for writing RAII-like scoped states (see example).
Definition: ScopedState.cs:22
- Template Parameters
-
| TState | Must be a value type. |
◆ 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. |