Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-12-31 23:13:01

----- Original Message -----
From: "Terje Slettebø" <tslettebo_at_[hidden]>

> To do that (without changing the Boost unit test code), I made a few
> forwarding macros, like this:
> #define BOOST_CHECK_EQUAL_CP(a,b)\
> IZE(b)##")");\

1) BOOST_STRINGIZE(a) will not *legally* expand. (It looks like the type of
thing that Metrowerks will expand anyway though.) In any case,
token-pasting happens prior to rescanning the replacement list, so the
concatenations happen first. Which...

2) undefined behavior: token-pasting yields multiple tokens.
Depending on how a particular preprocessor handles this, it might actually
cause BOOST_STRINGIZE to expand. What you want is this:

Fix: remove the concatenation operators. This will yield adjacent strings
which will already get concatenated (and do you mean BOOST_PP_STRINGIZE?):

#define BOOST_CHECK_EQUAL_CP(a, b) \
        "BOOST_CHECK_EQUAL(" \
        "," \
        ")" \
    ); \

Paul Mensonides

Boost list run by bdawes at, gregod at, cpdaniel at, john at