summaryrefslogtreecommitdiff
path: root/src/common/scope_exit.h
diff options
context:
space:
mode:
authorGravatar Emmanuel Gil Peyrot2016-09-18 09:38:01 +0900
committerGravatar Emmanuel Gil Peyrot2016-09-18 09:38:01 +0900
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/common/scope_exit.h
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Sources: Run clang-format on everything.
Diffstat (limited to '')
-rw-r--r--src/common/scope_exit.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 08f09a8c8..73b2a262e 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -4,20 +4,25 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "common/common_funcs.h"
8#include <utility> 7#include <utility>
8#include "common/common_funcs.h"
9 9
10namespace detail { 10namespace detail {
11 template <typename Func> 11template <typename Func>
12 struct ScopeExitHelper { 12struct ScopeExitHelper {
13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {} 13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {
14 ~ScopeExitHelper() { func(); } 14 }
15 ~ScopeExitHelper() {
16 func();
17 }
15 18
16 Func func; 19 Func func;
17 }; 20};
18 21
19 template <typename Func> 22template <typename Func>
20 ScopeExitHelper<Func> ScopeExit(Func&& func) { return ScopeExitHelper<Func>(std::move(func)); } 23ScopeExitHelper<Func> ScopeExit(Func&& func) {
24 return ScopeExitHelper<Func>(std::move(func));
25}
21} 26}
22 27
23/** 28/**