Boost logo

Boost Users :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2006-06-28 03:54:54


> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
> Johan Nilsson

> I guess this is more of a regular preprocessor question than
> a Boost.Preprocessor specific one, but:
>
> Shouldn't it be possible to concat tokens starting with (or
> solely consisting of) a '-'? The example at the end of this
> posting yields the
> errors:
>
> error: pasting "-" and "debug" does not give a valid
> preprocessing token
> error: pasting "foo" and "-" does not give a valid preprocessing token

Token-pasting must result in a single preprocessing token. So, there are a very
limited few things that you can paste with '-'. In particular, '-VARIANT' is
two pp-tokens, so the diagnostic is correct. For what you want to do below,
token-pasting isn't necessary. Just having...

#define NAME MODULE-VARIANT

BOOST_PP_STRINGIZE(NAME) // or: BOOST_PP_STRINGIZE(MODULE-VARIANT)

...should be sufficient.

Regards,
Paul Mensonides


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net