ScopeGuard template class is a idiom introduced by Andrei Alexandrescu and proposed for C++14 in N3949.
More...
#include "estd/ScopeGuard.hpp"
|
Function | function_ |
| function executed on scope exit More...
|
|
bool | released_ |
| true if object is released (bound function will not be executed), false otherwise More...
|
|
template<typename Function>
class estd::ScopeGuard< Function >
ScopeGuard template class is a idiom introduced by Andrei Alexandrescu and proposed for C++14 in N3949.
http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2014/n3949.pdf http://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C
- Template Parameters
-
Function | is the type of function executed on scope exit |
◆ ScopeGuard() [1/2]
template<typename Function >
ScopeGuard's constructor.
- Parameters
-
[in] | function | is a rvalue reference to function executed on scope exit |
◆ ScopeGuard() [2/2]
template<typename Function >
ScopeGuard's move constructor.
- Parameters
-
[in] | other | is a rvalue reference to ScopeGuard used as source of move |
◆ ~ScopeGuard()
template<typename Function >
ScopeGuard's destructor.
If not already "released", executes bound function.
◆ release()
template<typename Function >
Releases ScopeGuard.
After this call, the bound function will not be executed when this object goes out of scope.
◆ function_
template<typename Function >
function executed on scope exit
◆ released_
template<typename Function >
true if object is released (bound function will not be executed), false otherwise
The documentation for this class was generated from the following file: