
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Tobias Schwinger
Paul Mensonides wrote:
BOOST_PP_IF( n, BOOST_PP_TUPLE_EAT, BOOST_PP_TUPLE_REM )(1)( EXPENSIVE_MACRO_INVOCATION() )
...where EXPENSIVE_MACRO_INVOCATION() is only invoked if 'n' is 0.
Guessing from the overtone of your comment it would be better to say
BOOST_PP_IF(n, BOOST_PP_TUPLE_EAT(0), EXPENSIVE_MACRO_INVOCATION)()
to be on the safe side with less compliant preprocessors. Correct?
Yes. It's also just better. Sorry, it is getting late in the morning here, and I haven't slept yet.
---
#define MACRO(x) x MACRO(BOOST_PP_EMPTY())
BTW. is this special case safe (theoretically and practically, that is)?
On a good preprocessor, it's safe. Broken preprocessors tend to allow empty arguments anyway, so it should be safe there too. Regards, Paul Mensonides