OnScopeExitGuards

Classes

class  ScopeGuard< FunctionType >
 Executes a given function on scope exit. More...
 
struct  ScopeGuardOnExit
 Tag used by the macro ARMARX_ON_SCOPE_EXIT;. More...
 

Macros

#define ARMARX_ON_SCOPE_EXIT   auto ARMARX_ANONYMOUS_VARIABLE_WITH_PREFIX(SCOPE_EXIT_GUARD) = ::armarx::detail::ScopeGuardOnExit() + [&]()
 Executes given code when the enclosing scope is left. More...
 

Detailed Description

Macro Definition Documentation

◆ ARMARX_ON_SCOPE_EXIT

#define ARMARX_ON_SCOPE_EXIT   auto ARMARX_ANONYMOUS_VARIABLE_WITH_PREFIX(SCOPE_EXIT_GUARD) = ::armarx::detail::ScopeGuardOnExit() + [&]()

#include <ArmarXCore/core/util/OnScopeExit.h>

Executes given code when the enclosing scope is left.

(later macro instantiations are executed first (order of stack unwinding))

{
{
std::cout<<"bar";
}
{
std::cout<<"foo";
}
}

prints foobar on std::cout.

Definition at line 112 of file OnScopeExit.h.

ARMARX_ON_SCOPE_EXIT
#define ARMARX_ON_SCOPE_EXIT
Executes given code when the enclosing scope is left.
Definition: OnScopeExit.h:112