Create an anonymous local ScopeExit guard from EXIT_FUNC.
Synopsis
Declared in <bdlb_scopeexit.h>
#define BDLB_SCOPEEXIT_GUARD(EXIT_FUNC)
Description
Create a local variable with a generated unique name and with a type that is an instantiation of bdlb::ScopeExit initialized with the specified EXIT_FUNC. Note that the specific type of bdlb::ScopeExit used will depend on available language features. The behavior is undefined if this macro is used (expanded) more than once on the same source line. Note that using this macro in another macro more than once is equivalent to using it more than once on the same source line.
Parameters
Name |
Description |
EXIT_FUNC |
exit function or functor used to initialize the guard |
Created with MrDocs