Class executing a specified action on scope exit. More...
#include <eagine/scope_exit.hpp>
Public Types | |
using | action_type = callable_ref< void()> |
The callable action type. | |
Public Member Functions | |
on_scope_exit (action_type action) noexcept | |
Construction intializing with the specified action. | |
template<typename Func > | |
on_scope_exit (Func &action) noexcept | |
Construction intializing with the specified action. | |
on_scope_exit (on_scope_exit &&temp) noexcept | |
Move constructor. | |
on_scope_exit (const on_scope_exit &)=delete | |
Not copy constructible. | |
auto | operator= (on_scope_exit &&)=delete |
Not move constructible. | |
auto | operator= (const on_scope_exit &)=delete |
Not copy constructible. | |
~on_scope_exit () noexcept(false) | |
Invokes the stored action, unless it was released or cancelled. More... | |
auto | is_active () const noexcept -> bool |
Indicates if there is any on-scope-exit action. More... | |
auto | release () noexcept -> action_type |
Moves out and returns the stored action. More... | |
void | cancel () noexcept |
Resets the stored action to empty default. More... | |
Class executing a specified action on scope exit.
|
inlinenoexcept |
|
inlinenoexcept |
Resets the stored action to empty default.
Referenced by eagine::func_on_scope_exit< Func, OnException >::cancel().
|
inlinenoexcept |
|
inlinenoexcept |