11 #ifndef RETDEC_UTILS_SCOPE_EXIT_H
12 #define RETDEC_UTILS_SCOPE_EXIT_H
15 #define SCOPE_EXIT_CONCATENATE_IMPL(s1, s2) s1##s2
16 #define SCOPE_EXIT_CONCATENATE(s1, s2) SCOPE_EXIT_CONCATENATE_IMPL(s1, s2)
18 #define SCOPE_EXIT_ANONYMOUS_VARIABLE \
19 SCOPE_EXIT_CONCATENATE(SCOPE_EXIT_ANONYMOUS_VARIABLE_, __LINE__)
42 const auto SCOPE_EXIT_ANONYMOUS_VARIABLE = \
43 retdec::utils::ScopeExitGuardHelper() + [&]()
49 template<
typename Function>
53 f(std::forward<Function>(
f)) {}
63 template<
typename Function>
Definition: scope_exit.h:50
ScopeExitGuard(Function &&f)
Definition: scope_exit.h:52
Function f
Definition: scope_exit.h:57
~ScopeExitGuard()
Definition: scope_exit.h:54
auto operator+(ScopeExitGuardHelper, Function &&f)
Definition: scope_exit.h:64
Definition: archive_wrapper.h:19
Definition: scope_exit.h:61