The constructor parameter exit_func in the following constructors shall be : ‐ a reference to a function ‐ or a reference to a function object([function.objects])

Synopsis

Declared in <beman/scope/scope.hpp>

template<
    typename EF,
    typename CHKR>
constexpr
scope_guard(
    EF&& exit_func,
    CHKR&& invoke_checker) noexcept(std::is_nothrow_constructible_v<ScopeExitFunc> && std::is_nothrow_constructible_v<InvokeChecker>);

Description

If EFP is not an lvalue reference type and is_nothrow_constructible_v<EF,EFP> is true, initialize exit_function with std::forward<EFP>(f); otherwise initialize exit_function with f.

scope_fail / scope_exit If the initialization of exit_function throws an exception, calls f().

scope_success [Note: If initialization of exit_function fails, f() won't be called. end note]

Parameters

Name

Description

exit_func

The object to move construct from