template <typename T>
muu::scope_success class

Performs actions when going out of scope only if no exceptions have been thrown.

Template parameters
T A noexcept function, lambda or other callable not requiring any arguments (e.g. void() noexcept)`.

Constructors, destructors, conversion operators

template <typename U>
scope_success(U&& func) explicit noexcept(…)
Constructs a scope_success by wrapping a callable.

Public functions

void dismiss() noexcept
Dismisses the scope guard, cancelling invocation of the wrapped callable.
auto dismissed() const -> bool noexcept
Returns true if the scope guard has been dismissed.

Function documentation

template <typename T>
template <typename U>
muu::scope_success::scope_success(U&& func) explicit noexcept(…)

Constructs a scope_success by wrapping a callable.

Template parameters
U A function, lambda or other callable with the signature void() noexcept.
Parameters
func The callable to invoke when the scope guard goes out of scope.