4#include "../Foundation/Compiler.h"
constexpr T && forward(typename TypeTraits::RemoveReference< T >::type &value)
Forwards an lvalue or an rvalue as an rvalue reference.
Definition: Compiler.h:272
Deferred< F > MakeDeferred(F &&f)
Creates a Deferred object holding a function that will be invoked at end of current scope.
Definition: Deferred.h:61
Executes a function at end of current scope (in the spirit of Zig defer keyword).
Definition: Deferred.h:39
Deferred(F &&f)
Constructs Deferred object with a functor F.
Definition: Deferred.h:41
void disarm()
Disarms the Deferred object, preventing function invocation on destruction.
Definition: Deferred.h:51
~Deferred()
Invokes the function F upon destruction, if disarm() has not been previously called.
Definition: Deferred.h:44