:relfileprefix: ../../
[#DF36361B2D794B348BA4518FCDA3472EF92DE844]

= Function make_scope_exit

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


== Synopsis

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
template<typename F>
xref:boost/scope/scope_exit-0a.adoc[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

pass:v,q[**Effects:** Constructs a scope guard as if by calling] pass:v,q[`scope_exit]
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_exit-0a.adoc[scope_exit]<decay<F>::type>` 


== Parameters

|===
| Name | Type 

| *func*
| `F&&`

| *active*
| `bool`

|===



