![]() |
Gorgon Game Engine
|
This class guards a scope and as soon as the object runs out of scope calls the given function. More...
Public Member Functions | |
| ScopeGuard ()=default | |
| Construct an empty scope guard. More... | |
| ScopeGuard (const ScopeGuard &)=delete | |
| No copying. More... | |
| template<class F_ > | |
| ScopeGuard (F_ &&fn) | |
| Construct a scope guard with the given function. More... | |
| ScopeGuard (ScopeGuard &&other) | |
| Move constructor. More... | |
| ~ScopeGuard () | |
| Destructor. More... | |
| template<class F_ > | |
| void | Arm (F_ &&value) |
| Arms the scope guard with the given function. More... | |
| void | Disarm () |
| Disarm this scope guard, after this function it will not fire. More... | |
| ScopeGuard & | operator= (const ScopeGuard &)=delete |
| No copy assignment. More... | |
| ScopeGuard & | operator= (ScopeGuard &&other) |
| Move assignment. More... | |
This class guards a scope and as soon as the object runs out of scope calls the given function.
| ScopeGuard | ( | F_ && | fn | ) |
Construct a scope guard with the given function.
|
default |
Construct an empty scope guard.
| ScopeGuard | ( | ScopeGuard && | other | ) |
Move constructor.
|
delete |
No copying.
| ~ScopeGuard | ( | ) |
Destructor.
| void Arm | ( | F_ && | value | ) |
Arms the scope guard with the given function.
| void Disarm | ( | ) |
Disarm this scope guard, after this function it will not fire.
|
delete |
No copy assignment.
| ScopeGuard& operator= | ( | ScopeGuard && | other | ) |
Move assignment.