This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: catenation of CPP tokens


On Aug 5, 2004, at 4:55 PM, byron@facet.com wrote:

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.

The token pasting is neither necessary nor allowed. Just write __CLASS__ :: __FUNC__ without the ##. my_class::my_method is three tokens, not one.


--Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]