:relfileprefix: ../../
[#7720BDE17816BEE75F9AC14E9EA3C1984607CCA8]

= Function make_scope_fail

pass:v,q[Creates a scope fail guard with a given action function object.]


== Synopsis

Declared in header `<https://github.com/Lastique/scope/blob/develop/include/boost/scope/scope_fail.hpp#L218[boost/scope/scope_fail.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
template<typename F>
xref:boost/scope/scope_fail-04.adoc[scope_fail]<decay<F>::type>
make_scope_fail(
    F&& func,
    bool active = true) noexcept(std::is_nothrow_constructible<scope_fail<typename std::decay<F>::type>, F, bool>::value);
----

== Description

pass:v,q[**Effects:** Constructs a scope guard as if by calling] pass:v,q[`scope_fail]
pass:v,q[<]
pass:v,q[std::decay_t]
pass:v,q[<]
pass:v,q[F > >(std::forward]
pass:v,q[<]
pass:v,q[F >(func), active)`.]



== Return Value

* `xref:boost/scope/scope_fail-04.adoc[scope_fail]<decay<F>::type>` 


== Parameters

|===
| Name | Type 

| *func*
| `F&&`

| *active*
| `bool`

|===



