summaryrefslogtreecommitdiff
path: root/src/common/scope_exit.h
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-09-21 11:29:48 -0700
committerGitHub <noreply@github.com>2016-09-21 11:29:48 -0700
commitd5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a (patch)
tree8a22ca73ff838f3f0090b29a548ae81087fc90ed /src/common/scope_exit.h
parent2a910a6d883f2227edc74aacf5b93a58a3dea07c (diff)
parent0e3f0120a8ec2996e73bb6b7b6c9d7531f7a7eb1 (diff)
Merge pull request #2086 from linkmauve/clang-format
Add clang-format as part of our {commit,travis}-time checks
Diffstat (limited to 'src/common/scope_exit.h')
-rw-r--r--src/common/scope_exit.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 08f09a8c8..072ab285d 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -4,20 +4,24 @@
#pragma once
-#include "common/common_funcs.h"
#include <utility>
+#include "common/common_funcs.h"
namespace detail {
- template <typename Func>
- struct ScopeExitHelper {
- explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {}
- ~ScopeExitHelper() { func(); }
+template <typename Func>
+struct ScopeExitHelper {
+ explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {}
+ ~ScopeExitHelper() {
+ func();
+ }
- Func func;
- };
+ Func func;
+};
- template <typename Func>
- ScopeExitHelper<Func> ScopeExit(Func&& func) { return ScopeExitHelper<Func>(std::move(func)); }
+template <typename Func>
+ScopeExitHelper<Func> ScopeExit(Func&& func) {
+ return ScopeExitHelper<Func>(std::move(func));
+}
}
/**