Boost logo

Boost Users :

From: Andy Little (andy_at_[hidden])
Date: 2006-01-21 04:53:28

"Paul Mensonides" wrote

> You aren't attempting to concatenate 1e and -1; you're attempting to
> concatenate
> 1e and -. I.e. token pasting is only operating on the two adjacent
> preprocessing tokens...
> <1e> ## <-> <1>
> The result of this *should* be
> <1e-> <1>
> ...because 1e- is a valid pp-number. However, it should not be <le-1>. To
> make
> that, you'd have to first paste on the <->, then paste on the other number:
> #define CAT(a, b) PRIMITIVE_CAT(a, b)
> #define PRIMITIVE_CAT(a, b) a ## b
> CAT(CAT(1e, -), 1)
> This works for me (as it should) on gcc3.4.4. I can't speak for gcc3.2.

Thanks Paul. It works on gcc3.2, however I need to use CAT(Sign, Number) (or
Just Sign ## Number) in the Macro too and then I get a bunch of warnings

test.cpp:25:22: warning: pasting "-" and "60" does not give a valid
preprocessing token


Andy Little

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at