
29 Jan
2006
29 Jan
'06
3:53 a.m.
"Paul Mensonides" <pmenso57@comcast.net> wrote
BOOST_PP_IF(1, BOOST_PP_ENUM_PARAMS(3, p), blah) ENUM_PARAMS is an intermediate if the repetition count is higher than one. An "intermediate" is a single argument that expands to multiple arguments--which creates pathological input that IF cannot deal with:
#define IF(cond, t, f) IIF(BOOL(cond), t, f)
When IF is invoked, the argument for 't' (in particular) gets expanded prior to substitution of 't' in the replacement list of IF (long before IIF is invoked). This results in:
IIF(BOOL(1), p0, p1, p2, blah)
Which is clearly too many arguments to IIF.
Well, this was simple :-) Thanks a lot for the explanation. Regards, Arkadiy