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
 Executes given code when the enclosing scope is left.
 

Detailed Description

Macro Definition Documentation

◆ ARMARX_ON_SCOPE_EXIT

#define ARMARX_ON_SCOPE_EXIT

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

Value:
auto ARMARX_ANONYMOUS_VARIABLE_WITH_PREFIX(SCOPE_EXIT_GUARD) = \
::armarx::detail::ScopeGuardOnExit() + [&]()
#define ARMARX_ANONYMOUS_VARIABLE_WITH_PREFIX(pre)
creates a identifier with a given prefix.
Definition anonymous_variable.h:55

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";
}
}
#define ARMARX_ON_SCOPE_EXIT
Executes given code when the enclosing scope is left.
Definition OnScopeExit.h:120

prints foobar on std::cout.