diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:57:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:57:46 +0200 |
commit | ad4e3d2c55e75193c41356c23619f80add41db18 (patch) | |
tree | dd836d120f50e472106e04968ef8185c25e4242e /zen/scope_guard.h | |
parent | 7.4 (diff) | |
download | FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.gz FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.bz2 FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.zip |
7.5
Diffstat (limited to 'zen/scope_guard.h')
-rw-r--r-- | zen/scope_guard.h | 10 |
1 files changed, 5 insertions, 5 deletions
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; }; |