Re: C++ Macros, ##, and ::

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 27 Mar 2008 16:59:51 -0400, Harvey Chapman wrote:

>#define MT(name) { name::Type, name::Create }
>
>work, and ...
>
>#define MT(name) { name##::Type, name##::Create }
>
>does not?

Because name, '::' and Type are each distinct tokens, i.e. you don't
need to concat them. The standard says that the result of token pasting
again needs to be a valid preprocessing token and name::Type isn't.

Philipp
-- 
This is the Gentoo generation: Can't program but wants to compile
everything from source.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux