From ad4e3d2c55e75193c41356c23619f80add41db18 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 2 Oct 2015 14:57:46 +0200 Subject: 7.5 --- zen/scope_guard.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'zen/scope_guard.h') diff --git a/zen/scope_guard.h b/zen/scope_guard.h index 5e917853..b5564c9b 100644 --- a/zen/scope_guard.h +++ b/zen/scope_guard.h @@ -17,13 +17,13 @@ namespace zen //Scope Guard /* zen::ScopeGuard lockAio = zen::makeGuard([&] { ::CloseHandle(hDir); }); - ... - lockAio.dismiss(); + ... + lockAio.dismiss(); */ //Scope Exit /* - ZEN_ON_SCOPE_EXIT(::CloseHandle(hDir)); + ZEN_ON_SCOPE_EXIT(::CloseHandle(hDir)); */ class ScopeGuardBase @@ -32,7 +32,7 @@ public: void dismiss() { dismissed_ = true; } protected: - ScopeGuardBase() : dismissed_(false) {} + ScopeGuardBase() {} ScopeGuardBase(ScopeGuardBase&& other) : dismissed_(other.dismissed_) { other.dismiss(); } //take over responsibility ~ScopeGuardBase() {} //[!] protected non-virtual base class destructor @@ -42,7 +42,7 @@ private: ScopeGuardBase (const ScopeGuardBase&) = delete; ScopeGuardBase& operator=(const ScopeGuardBase&) = delete; - bool dismissed_; + bool dismissed_ = false; }; -- cgit