Return a ScopeExit guard that invokes function on destruction.
Synopsis
Declared in <bdlb_scopeexit.h>
template<class EXIT_FUNC_PARAM>
[[nodiscard]]
static
ScopeExit<bsl::decay<EXIT_FUNC_PARAM>::type>
makeScopeExit(EXIT_FUNC_PARAM&& function);
Description
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.
Return Value
ScopeExit guard that invokes function on destruction
|
Note
|
The return value should not be discarded. |
Parameters
Name |
Description |
function |
exit function or functor for the returned guard |
Created with MrDocs