Site Archive (Complete)
C++ Blog: More News From the Front
C++
void main(void)

Calls, Returns and In-Between.

by Kevin Carlson
SELECTIVE IGNORANCE

Finding the Signal in the Noise

by Andrew Koenig
April 19, 2006

More News From the Front

The next revision of the C++ Standard, tentatively titled C++0x (the 'x' is a placeholder, intended to suggest that the revision will be finished before 2010, although some people like to remind us that "0x" introduces a hexadecimal constant, so C++0x really has to be finished by 2015), will have language and library changes that fix problems in the current revision.

One of the most annoying things about writing template code is that when you have nested templates you have to separate the two >'s that terminate them. You have to write X > instead of the more natural X>, because >> is a token. One of the language changes is to allow X>. The compiler will recognize that it's reading a template instantiation, and treat the two > characters as separate tokens.

Another addition is "extern template", which provides a syntax for telling the compiler that a specific template instantiation will be provided somewhere else. If you write shared libraries you've had to deal with this problem: you put a template instantiation into a shared library, and you don't want the compiler to use that version of the code instead of expanding the template where it's used. "extern template" is a common extension, and the language definition now (well, when the new version is approved, a few years from now) blesses it.

I'm running out of time; more later.

Posted by Pete Becker at 08:33 AM  Permalink




 
INFO-LINK


Related Sites: DotNetJunkies, SD Expo, SqlJunkies