a helper class to perform actions on scope exit
More...
#include <userver/utils/scope_guard.hpp>
a helper class to perform actions on scope exit
Usage example:
- Note
- exception handling is done in such way that std::terminate will not be called: in the normal path of execution, exception from handler will propagate into client code, but if we leave scope because of an exception, handler's exception, if thrown, will be silenced and written into log to avoid std::terminate
Definition at line 28 of file scope_guard.hpp.
◆ Callback
using utils::ScopeGuard::Callback = std::function<void()> |
◆ ScopeGuard()
utils::ScopeGuard::ScopeGuard |
( |
Callback |
callback | ) |
|
|
inlineexplicit |
◆ ~ScopeGuard()
utils::ScopeGuard::~ScopeGuard |
( |
| ) |
|
|
inline |
◆ Release()
void utils::ScopeGuard::Release |
( |
| ) |
|
|
inlinenoexcept |
The documentation for this class was generated from the following file: