[#BloombergLP-bdlb-ScopeExit-0e-2constructor-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/ScopeExit-0e.adoc[ScopeExit]::ScopeExit
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;bdlb&lowbar;scopeexit&period;h&gt;`

Move&hyphen;construct from `original` and release the moved&hyphen;from object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-07.adoc[ScopeExit](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;ScopeExit&gt;] original) noexcept(&sol;&ast; see-below &ast;&sol;);
----

[.small]#xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-07.adoc[_» more&period;&period;&period;_]#

Create a `ScopeExit` that will invoke `function` on destruction&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-05.adoc[ScopeExit](void(* function)());
----

[.small]#xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-05.adoc[_» more&period;&period;&period;_]#

Create a `ScopeExit` that will invoke `function` on destruction&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class EXIT&lowbar;FUNC&lowbar;PARAM&gt;
explicit
xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-06.adoc[ScopeExit](EXIT&lowbar;FUNC&lowbar;PARAM&& function)
requires bsl&colon;&colon;is&lowbar;constructible&lt;  &sol;&sol; Copy construct
            EXIT&lowbar;FUNC,
            const typename MoveUtil&colon;&colon;Decay&lt;EXIT&lowbar;FUNC&lowbar;PARAM&gt;&colon;&colon;type&amp;
        &gt;&colon;&colon;value                                                             &verbar;&verbar;
        bsl&colon;&colon;is&lowbar;constructible&lt;  &sol;&sol; Move construct
            EXIT&lowbar;FUNC,
            bslmf&colon;&colon;MovableRef&lt;typename MoveUtil&colon;&colon;Decay&lt;EXIT&lowbar;FUNC&lowbar;PARAM&gt;&colon;&colon;type&gt;
        &gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-06.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| scope exit object to move from
| *function*
| function pointer invoked on destruction unless `release` is called
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
