Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-06-03 22:00:25


> -----Original Message-----

> Well i did manage to get it to compile by simply adding a
> primary template declaration for the policy class. <cringe>
>
> It seemed to be behaving all right until i tried to
> preprocess the following (and i wonder if i caused this
> behavior by my above tinkering or whether this is truly
> standard behavior):
>
>
> #define C C
>
> #if C
> X()
> #endif
>
> Wave spits out that this is an ill-formed preprocessor expression -

The expression of an #if (or #elif) directive should get four passes.
The first pass handles the defined operator. Each instance of defined
XYZ and defined(XYZ) is replaced with 0 or 1. The second pass does
macro expansion. For the expression above, macro expansion results in
C. The third pass converts all remaining identifier tokens, with the
exception of true and false, with 0. (Note that that alternative tokens
are not identifiers, so this doesn't apply to them.) Finally, yielding
the expression 0. The fourth pass finally evaluates the expression,
which should evaluate to false.

Regards,
Paul Mensonides


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