OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Classes | Macros
ScopeGuard.h File Reference
#include <utility>
#include "Preprocessor.h"

Classes

class  ScopeGuard< T >
 

Macros

#define MM_AT_SCOPE_EXIT(...)    auto MM_PP_CAT(guard, __LINE__) = ScopeGuard([&] { __VA_ARGS__; })
 

Macro Definition Documentation

◆ MM_AT_SCOPE_EXIT

#define MM_AT_SCOPE_EXIT (   ...)     auto MM_PP_CAT(guard, __LINE__) = ScopeGuard([&] { __VA_ARGS__; })

Runs provided statements at scope exit by creating a temporary ScopeGuard object.

Example usage:

value = 10;
MM_AT_SCOPE_EXIT(value = 1);
#define MM_AT_SCOPE_EXIT(...)
Definition: ScopeGuard.h:38