summaryrefslogtreecommitdiff
path: root/zen/scope_guard.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/scope_guard.h')
-rw-r--r--zen/scope_guard.h10
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;
};
bgstack15