[#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 `<bdlb_scopeexit.h>` Move‐construct from `original` and release the moved‐from object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-07.adoc[ScopeExit](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<ScopeExit>] original) noexcept(/* see-below */); ---- [.small]#xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-07.adoc[_» more..._]# Create a `ScopeExit` that will invoke `function` on destruction. [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..._]# Create a `ScopeExit` that will invoke `function` on destruction. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class EXIT_FUNC_PARAM> explicit xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-06.adoc[ScopeExit](EXIT_FUNC_PARAM&& function) requires bsl::is_constructible< // Copy construct EXIT_FUNC, const typename MoveUtil::Decay<EXIT_FUNC_PARAM>::type& >::value || bsl::is_constructible< // Move construct EXIT_FUNC, bslmf::MovableRef<typename MoveUtil::Decay<EXIT_FUNC_PARAM>::type> >::value; ---- [.small]#xref:BloombergLP/bdlb/ScopeExit-0e/2constructor-06.adoc[_» more..._]# == 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]#