BOOST_SCOPE_EXIT_ID_TPL — This macro is required to expand multiple scope exit declarations on the same line within templates on various versions of GCC.
// In header: <boost/scope_exit.hpp> BOOST_SCOPE_EXIT_ID_TPL(id, capture_list)
This macro is equivalent to
BOOST_SCOPE_EXIT_TPL but it can be expanded multiple times on the same line if different identifiers
id are provided for each expansion (see
BOOST_SCOPE_EXIT_TPL for more information). As with
BOOST_SCOPE_EXIT_TPL, it is recommended to always use this macro when expanding scope exits multiple times on the same line within templates.
||A unique identifier token which can be concatenated by the preprocessor (
||Same as the
Note: This macro can be useful when the scope exit macros are expanded within user-defined macros (because nested macros expand on the same line). On some compilers (e.g., MSVC which supports the non standard
__COUNTER__ macro) it might not be necessary to use this macro but the use of this macro is always necessary to ensure portability when expanding multiple scope exit declarations on the same line.