Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2006-01-28 21:53:15


"Paul Mensonides" <pmenso57_at_[hidden]> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk