Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Macro BOOST_SCOPE_EXIT_END_ID

BOOST_SCOPE_EXIT_END_ID — This macro allows to terminate multiple scope exit bodies on the same line.

Synopsis

// In header: <boost/scope_exit.hpp>

BOOST_SCOPE_EXIT_END_ID(id)

Description

This macro is equivalent to BOOST_SCOPE_EXIT_END but it can be expanded multiple times on the same line if different identifiers id are provided for each expansion (see BOOST_SCOPE_EXIT_END for more information).

Parameters:

id A unique identifier token which can be concatenated by the preprocessor (__LINE__, scope_exit_number_1_on_line_123, a combination of alphanumeric tokens, etc).

Note: This macro can be useful when the scope exit macros are expanded within user-defined macros (because macros all 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 macros on the same line (because this library can only portably use __LINE__ to internally generate unique identifiers).

See: BOOST_SCOPE_EXIT_ID, BOOST_SCOPE_EXIT_ID_TPL, BOOST_SCOPE_EXIT_END.


PrevUpHomeNext