diff options
author | rtk0c <[email protected]> | 2021-05-06 21:56:40 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-05-06 21:56:40 -0700 |
commit | 1fd1e4b5f2418e3ac2909658993bfedb615537ec (patch) | |
tree | 6de080d2273890f8a74d7fcd3572bb44f44ac545 /core/src/Utils/ScopeGuard.hpp | |
parent | 538e804fc9beb83e711a210ffbb6badc15f285d5 (diff) |
Change brace style to on new line, add initial deliveries view when an order entry is selected
Diffstat (limited to 'core/src/Utils/ScopeGuard.hpp')
-rw-r--r-- | core/src/Utils/ScopeGuard.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/src/Utils/ScopeGuard.hpp b/core/src/Utils/ScopeGuard.hpp index ed8d4ea..28ffd0b 100644 --- a/core/src/Utils/ScopeGuard.hpp +++ b/core/src/Utils/ScopeGuard.hpp @@ -5,7 +5,8 @@ #include <utility> template <class TCleanupFunc> -class ScopeGuard { +class ScopeGuard +{ private: TCleanupFunc mFunc; bool mDismissed = false; @@ -18,16 +19,19 @@ public: /// would work. It is highly discourage and unlikely that one would want to use ScopeGuard as a function /// parameter, so the normal argument that implicit conversion are harmful doesn't really apply here. ScopeGuard(TCleanupFunc func) - : mFunc{ std::move(func) } { + : mFunc{ std::move(func) } + { } - ~ScopeGuard() { + ~ScopeGuard() + { if (!mDismissed) { mFunc(); } } - void Dismiss() noexcept { + void Dismiss() noexcept + { mDismissed = true; } }; |