From 1fd1e4b5f2418e3ac2909658993bfedb615537ec Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 6 May 2021 21:56:40 -0700 Subject: Change brace style to on new line, add initial deliveries view when an order entry is selected --- core/src/Utils/ScopeGuard.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'core/src/Utils/ScopeGuard.hpp') 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 template -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; } }; -- cgit v1.2.3-70-g09d2