|  | Ark Server API (ASA) - Wiki
    | 
Go to the source code of this file.
| Classes | |
| class | ScopeExitSupport::TScopeGuard< FuncType > | 
| struct | ScopeExitSupport::FScopeGuardSyntaxSupport | 
| Namespaces | |
| namespace | ScopeExitSupport | 
| #define ON_SCOPE_EXIT const auto UE_PRIVATE_SCOPE_EXIT_JOIN(ScopeGuard_, __LINE__) = ::ScopeExitSupport::FScopeGuardSyntaxSupport() + [&]() | 
Enables a lambda to be executed on scope exit.
Example: { FileHandle* Handle = GetFileHandle(); ON_SCOPE_EXIT { CloseFile(Handle); };
DoSomethingWithFile( Handle );
// File will be closed automatically no matter how the scope is exited, e.g.: // * Any return statement. // * break or continue (if the scope is a loop body). // * An exception is thrown outside the block. // * Execution reaches the end of the block. }
Definition at line 73 of file ScopeExit.h.
Definition at line 48 of file ScopeExit.h.