
<adam.butcher <at> selex-comms.com> writes:
It should pan out okay -- it is pretty rude to make 'this(...)' a macro, though since C++ doesn't allow that syntax (that I'm aware of) it should be innocuous and will still generate an appropriate error if the user did, in error, use this(...).
I'm not an expert in a preprocessor but if we assume this(arg) macro is ok, then do(arg) must be ok as well: #include <boost/preprocessor/cat.hpp> #include <boost/scope_exit.hpp> #define BOOST_AUX_SCOPE_EXIT_later() BOOST_SCOPE_EXIT(BOOST_PP_EMPTY()) #define BOOST_AUX_SCOPE_EXIT_end() BOOST_SCOPE_EXIT_END #define do(when) BOOST_PP_CAT(BOOST_AUX_SCOPE_EXIT_,when)() int main() { do(later) { int i = 0; } do(end); // or do(ne) ? } Gcc 3.4 compiles this code. Alex