Boost logo

Boost :

Subject: [boost] [preprocessor] PP_CAT with symbols
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2011-09-24 13:54:37

Hello all,

I just want to confirm that the following:

BOOST_PP_CAT(old_size =, =)

correctly (and always) expands to:

old_size ==

I tested it on MSVC and GCC and it works. Plus from GCC documentation says
about ##:

Usually both will be identifiers, or one will be an identifier and the other
a preprocessing number. When pasted, they make a longer identifier. This
isn't the only valid case. It is also possible to concatenate two numbers
(or a number and a name, such as 1.5 and e3) into a number. Also,
multi-character operators such as += can be formed by token pasting.

I am asking because ## has some limitation (x ## = is not valid, etc) so I
want to confirm my understanding is correct.

Thanks a lot.

View this message in context:
Sent from the Boost - Dev mailing list archive at

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