
10 Aug
2011
10 Aug
'11
3:29 p.m.
On 08/10/2011 05:22 PM, damien benoist wrote:
Yes, I've seen that.
I think I've also seen the possibility to test wether it expends to 0 or any number from 1 to some maximum.
And some people here also talked about chaos. It seems that it also alowsto test wether a macro expands to "0 and nothing (i.e. a placemarker)" (chaos_pp_placemarker_if) It is described as C99 specific (I suppose it uses __VA_ARGS__).
But what I would like is to expand to some value by default and another if a given macro is set.
You can do something like: #ifdef FOO # define FOO_ISSET 1 #else # define FOO_ISSET 0 #endif # define BAR BOOST_PP_IF(FOO_ISSET, FOO, bar) -- Maxime