diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
commit | dc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch) | |
tree | 569a7f13128450bbab973236615587ff00bced5f /src/common/scope_exit.h | |
parent | Travis: Import Dolphin’s clang-format hook. (diff) | |
download | yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2 yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip |
Diffstat (limited to 'src/common/scope_exit.h')
-rw-r--r-- | src/common/scope_exit.h | 23 |
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 @@ #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)); +} } /** |