12 #ifndef ESTD_SCOPEGUARD_HPP_ 13 #define ESTD_SCOPEGUARD_HPP_ 29 template<
typename Function>
40 constexpr
explicit ScopeGuard(Function&&
function) noexcept :
106 template <
typename Function>
114 #endif // ESTD_SCOPEGUARD_HPP_ Collection of useful templates.
Definition: DmaChannel.hpp:121
Function function_
function executed on scope exit
Definition: ScopeGuard.hpp:90
ScopeGuard< Function > makeScopeGuard(Function &&function) noexcept
Helper factory function to make ScopeGuard object with deduced template arguments.
Definition: ScopeGuard.hpp:107
void release() noexcept
Releases ScopeGuard.
Definition: ScopeGuard.hpp:78
~ScopeGuard() noexcept
ScopeGuard's destructor.
Definition: ScopeGuard.hpp:66
ScopeGuard template class is a idiom introduced by Andrei Alexandrescu and proposed for C++14 in N394...
Definition: ScopeGuard.hpp:30
ScopeGuard(ScopeGuard &&other) noexcept
ScopeGuard's move constructor.
Definition: ScopeGuard.hpp:53
bool released_
true if object is released (bound function will not be executed), false otherwise
Definition: ScopeGuard.hpp:93
constexpr ScopeGuard(Function &&function) noexcept
ScopeGuard's constructor.
Definition: ScopeGuard.hpp:40