diff options
Diffstat (limited to 'zen/scope_guard.h')
-rw-r--r-- | zen/scope_guard.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/zen/scope_guard.h b/zen/scope_guard.h index 791764de..1345447e 100644 --- a/zen/scope_guard.h +++ b/zen/scope_guard.h @@ -73,11 +73,11 @@ public: ~ScopeGuard() noexcept(runMode != ScopeGuardRunMode::ON_SUCCESS) { + if (!dismissed) + { #ifdef _MSC_VER #pragma warning(suppress: 4127) //"conditional expression is constant" #endif - if (!dismissed) - { if (runMode != ScopeGuardRunMode::ON_EXIT) { const bool failed = getUncaughtExceptionCount() > exeptionCount; @@ -85,6 +85,9 @@ public: return; } +#ifdef _MSC_VER + #pragma warning(suppress: 4127) //"conditional expression is constant" +#endif if (runMode == ScopeGuardRunMode::ON_SUCCESS) fun_(); //throw X else |