Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ScopeExit.h File Reference

Go to the source code of this file.

Classes

class  ScopeExitSupport::TScopeGuard< FuncType >
 
struct  ScopeExitSupport::FScopeGuardSyntaxSupport
 

Namespaces

namespace  ScopeExitSupport
 

Macros

#define UE_PRIVATE_SCOPE_EXIT_JOIN(A, B)   UE_PRIVATE_SCOPE_EXIT_JOIN_INNER(A, B)
 
#define UE_PRIVATE_SCOPE_EXIT_JOIN_INNER(A, B)   A##B
 
#define ON_SCOPE_EXIT   const auto UE_PRIVATE_SCOPE_EXIT_JOIN(ScopeGuard_, __LINE__) = ::ScopeExitSupport::FScopeGuardSyntaxSupport() + [&]()
 

Macro Definition Documentation

◆ ON_SCOPE_EXIT

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.

◆ UE_PRIVATE_SCOPE_EXIT_JOIN

#define UE_PRIVATE_SCOPE_EXIT_JOIN ( A,
B )   UE_PRIVATE_SCOPE_EXIT_JOIN_INNER(A, B)

Definition at line 48 of file ScopeExit.h.

◆ UE_PRIVATE_SCOPE_EXIT_JOIN_INNER

#define UE_PRIVATE_SCOPE_EXIT_JOIN_INNER ( A,
B )   A##B

Definition at line 49 of file ScopeExit.h.