Creates a scope guard with a given action function object.

Synopsis

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

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

Description

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

Return Value

Parameters

Name Type

func

F&&

active

bool