| template <typename T> | |
| class ScopeExit | |
| { | |
| public: | |
| ScopeExit(T t) : t(t) {} | |
| ~ScopeExit() { t(); } | |
| T t; | |
| }; | |
| template <typename T> | |
| ScopeExit<T> MoveScopeExit(T t) { | |
| return ScopeExit<T>(t); | |
| }; | |
| template <typename T> | |
| class ScopeExit | |
| { | |
| public: | |
| ScopeExit(T t) : t(t) {} | |
| ~ScopeExit() { t(); } | |
| T t; | |
| }; | |
| template <typename T> | |
| ScopeExit<T> MoveScopeExit(T t) { | |
| return ScopeExit<T>(t); | |
| }; | |