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

If `bsl&colon;&colon;is&lowbar;nothrow&lowbar;move&lowbar;constructible&lt;EXIT&lowbar;FUNC&gt;&colon;&colon;value` is `true` or `EXIT&lowbar;FUNC` is a move&hyphen;only type, move construct, otherwise, copy construct the exit function from the specified `original`&period; If construction succeeds, call `release()` on `original`&period;

== Synopsis

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

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

== Exception specification

This function is potentially-throwing unless `bsl&colon;&colon;is&lowbar;nothrow&lowbar;move&lowbar;constructible&lt;EXIT&lowbar;FUNC&gt;&colon;&colon;value &verbar;&verbar; bsl&colon;&colon;is&lowbar;nothrow&lowbar;copy&lowbar;constructible&lt;EXIT&lowbar;FUNC&gt;&colon;&colon;value`.


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