 |
Gorgon Game Engine
|
Go to the documentation of this file.
5 namespace Gorgon {
namespace Utils {
29 fn = std::move(other.fn);
44 void Arm(F_ &&value) {
45 fn = std::forward<F_>(value);
55 std::function<void()> fn;
ScopeGuard & operator=(ScopeGuard &&other)
Move assignment.
Definition: ScopeGuard.h:28
ScopeGuard(ScopeGuard &&other)
Move constructor.
Definition: ScopeGuard.h:21
ScopeGuard()=default
Construct an empty scope guard.
void Disarm()
Disarm this scope guard, after this function it will not fire.
Definition: ScopeGuard.h:38
~ScopeGuard()
Destructor.
Definition: ScopeGuard.h:49
This class guards a scope and as soon as the object runs out of scope calls the given function.
Definition: ScopeGuard.h:11
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
ScopeGuard(F_ &&fn)
Construct a scope guard with the given function.
Definition: ScopeGuard.h:15
void Arm(F_ &&value)
Arms the scope guard with the given function.
Definition: ScopeGuard.h:44
ScopeGuard(const ScopeGuard &)=delete
No copying.