[#BloombergLP-bdlb-ScopeExitUtil-makeScopeExit] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/ScopeExitUtil.adoc[ScopeExitUtil]::makeScopeExit :relfileprefix: ../../../ :mrdocs: Return a `ScopeExit` guard that uses the specified `function` as its exit function, and has the decayed type of `function` (class type or or function pointer type) as its exit function member type. == Synopsis Declared in `<bdlb_scopeexit.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class EXIT_FUNC_PARAM> [[nodiscard]] static xref:BloombergLP/bdlb/ScopeExit-0e.adoc[ScopeExit<bsl::decay<EXIT_FUNC_PARAM>::type>] makeScopeExit(EXIT_FUNC_PARAM&& function); ---- == Return Value [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== [.small]#Created with https://www.mrdocs.com[MrDocs]#