Create a ScopeExit object, which, upon its destruction will invoke the specified function unless the release method was called. If function is copied into the EXIT_FUNC member, and that copy throws an exception, invoke function and rethrow the exception. The behavior is undefined if function or the member instance of EXIT_FUNC throws an exception upon invocation. Note that this separate constructor for function pointers exists because without it the forwarding logic in the templated constructor implementation generates warnings about meaningless types generated.

Synopsis

Declared in <bdlb_scopeexit.h>

explicit
ScopeExit(void(* function)());

Created with MrDocs