My Project

ScopeGuard.hpp
Go to the documentation of this file.
1
5 #ifndef ESTD_SCOPEGUARD_HPP_
6 #define ESTD_SCOPEGUARD_HPP_
7
8 template<typename Function>
9 class ScopeGuard
10 {
11 public:
12
19 constexpr explicit ScopeGuard(Function&& function) noexcept :
20 function_{std::move(function)},
21 released_{}
22 {
23
24 }
25
32 ScopeGuard(ScopeGuard&& other) noexcept :
33 function_(std::move(other.function_)),
34 released_{other.released_}
35 {
36 other.release();
37 }
38 };
39
40 #endif // ESTD_SCOPEGUARD_HPP_
ScopeGuard
Definition: ScopeGuard.hpp:9
std
STL namespace.
ScopeGuard::ScopeGuard
constexpr ScopeGuard(Function &&function) noexcept
ScopeGuard&#39;s constructor.
Definition: ScopeGuard.hpp:19
ScopeGuard::ScopeGuard
ScopeGuard(ScopeGuard &&other) noexcept
ScopeGuard&#39;s move constructor.
Definition: ScopeGuard.hpp:32