24#define ML_UTILITIES_CONCATENATE_IMPL(s1,s2) s1##s2
25#define ML_UTILITIES_CONCATENATE(s1,s2) ML_UTILITIES_CONCATENATE_IMPL(s1,s2)
30#define ML_UTILITIES_ANONYMOUS_VARIABLE(str)\
31 ML_UTILITIES_CONCATENATE(str,__COUNTER__)
33#define ML_UTILITIES_ANONYMOUS_VARIABLE(str) \
34 ML_UTILITIES_CONCATENATE(str,__LINE__)
39 namespace ScopeGuardDetail
41 template <
class Functor>
51 : _f(
std::move(rhs._f))
52 , _active(rhs._active)
81 template <
class Functor>
97 auto ML_UTILITIES_ANONYMOUS_VARIABLE(SCOPE_EXIT_STATE) \
98 = ::ML_NAMESPACE::ScopeGuardDetail::ScopeGuardOnExit() + [&]()
116#define EXPLICIT_SCOPE_EXIT \
117 ::ML_NAMESPACE::ScopeGuardDetail::ScopeGuardOnExit() + [&]()
ScopeGuard(ScopeGuard &&rhs)
ScopeGuard< Functor > operator+(ScopeGuardOnExit, Functor &&fn)