Creates a scope fail guard with a given action function object.

Synopsis

Declared in header <boost/scope/scope_success.hpp>

template<typename F>
scope_success<decay<F>::type>
make_scope_success(
    F&& func,
    bool active = true) noexcept(std::is_nothrow_constructible<scope_success<typename std::decay<F>::type>, F, bool>::value);

Description

Effects: Constructs a scope guard as if by calling `scope_success < std::decay_t < F > >(std::forward < F >(func), active)`.

Return Value

Parameters

Name Type

func

F&&

active

bool