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