From 878a41d3be13da2a654df74f2a35ea8b295c8a13 Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 16 Oct 2018 17:33:51 -0400 Subject: 10.5 --- zen/scope_guard.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'zen/scope_guard.h') diff --git a/zen/scope_guard.h b/zen/scope_guard.h index d056bb2a..9eff6c1f 100755 --- a/zen/scope_guard.h +++ b/zen/scope_guard.h @@ -10,6 +10,7 @@ #include #include #include "type_traits.h" +#include "legacy_compiler.h" //std::uncaught_exceptions //best of Zen, Loki and C++17 @@ -103,8 +104,8 @@ auto makeGuard(F&& fun) { return ScopeGuard>(std::forwa #define ZEN_CHECK_CASE_FOR_CONSTANT_IMPL(X) L ## X -#define ZEN_ON_SCOPE_EXIT(X) auto ZEN_CONCAT(dummy, __LINE__) = zen::makeGuard([&]{ X; }); (void)ZEN_CONCAT(dummy, __LINE__); -#define ZEN_ON_SCOPE_FAIL(X) auto ZEN_CONCAT(dummy, __LINE__) = zen::makeGuard([&]{ X; }); (void)ZEN_CONCAT(dummy, __LINE__); -#define ZEN_ON_SCOPE_SUCCESS(X) auto ZEN_CONCAT(dummy, __LINE__) = zen::makeGuard([&]{ X; }); (void)ZEN_CONCAT(dummy, __LINE__); +#define ZEN_ON_SCOPE_EXIT(X) auto ZEN_CONCAT(scopeGuard, __LINE__) = zen::makeGuard([&]{ X; }); (void)ZEN_CONCAT(scopeGuard, __LINE__); +#define ZEN_ON_SCOPE_FAIL(X) auto ZEN_CONCAT(scopeGuard, __LINE__) = zen::makeGuard([&]{ X; }); (void)ZEN_CONCAT(scopeGuard, __LINE__); +#define ZEN_ON_SCOPE_SUCCESS(X) auto ZEN_CONCAT(scopeGuard, __LINE__) = zen::makeGuard([&]{ X; }); (void)ZEN_CONCAT(scopeGuard, __LINE__); #endif //SCOPE_GUARD_H_8971632487321434 -- cgit