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:260
Deferred< F > MakeDeferred(F &&f)
Creates a Deferred object holding a function that will be invoked at end of current scope.
Definition Deferred.h:40
Executes a function at end of current scope (in the spirit of Zig defer keyword).
Definition Deferred.h:18
Deferred(F &&f)
Constructs Deferred object with a functor F.
Definition Deferred.h:20
void disarm()
Disarms the Deferred object, preventing function invocation on destruction.
Definition Deferred.h:30
~Deferred()
Invokes the function F upon destruction, if disarm() has not been previously called.
Definition Deferred.h:23