This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: catenation of CPP tokens
- From: Falk Hueffner <hueffner at informatik dot uni-tuebingen dot de>
- To: byron at facet dot com
- Cc: gcc at gnu dot org
- Date: Fri, 06 Aug 2004 02:02:09 +0200
- Subject: Re: catenation of CPP tokens
- References: <34994.10.10.10.11.1091750118.squirrel@mail.facet.com>
byron@facet.com writes:
> Using Sun's Forte6, I can paste tokens together
> e.g. __CLASS__##::##__FUNC__ in a macro to create a valid name for a
> member of a C++ class. However, using GCC, although documented as
> working, this fails because any two of the three tokens do not make
> a valid token i.e. __CLASS__##:: and ::##__FUNC__ are invalid.
This is not valid code, and it's certainly not documented to work, so
there is no reason to expect it to.
> Any comment or sneaky work-around would be appreciated.
Leave off the ##.
--
Falk