
10 Aug
2011
10 Aug
'11
5:20 p.m.
On 08/10/2011 06:57 PM, damien benoist wrote:
Then there would be no more need for the if. But I would like to not even have one line to write for each macro.
Thanks for your answer.
Is it possible for you to make the macro defined to some special value rather than being undefined ? Something like : #include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/facilities/empty.hpp> #include <boost/preprocessor/list/adt.hpp> #ifdef DEFINE_FOO # define FOO (foo, BOOST_PP_NIL) #else // Rather than being undefined, make it an empty list # define FOO (BOOST_PP_NIL) #endif # define BAR BOOST_PP_IF(BOOST_PP_LIST_IS_NIL(FOO), \ bar,\ BOOST_PP_LIST_FIRST(FOO)) -- Maxime