This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: Re: C++ PATCH: PR 20599 (1/3)


On 9/18/06, Mark Mitchell <mark@codesourcery.com> wrote:
So, I'm somewhat hesitant to incorporate changes before the standard is
sufficiently final.  At the same time, I of course think that providing
support for the latest and greatest form of the C++ language in G++
would be a very good thing.

I understand. It's a chicken-and-egg problem. The C++ committee does not want to standardize anything that isn't "existing practice," but compiler vendors (understandably!) only want to implement features that look relatively final, because they don't want to be left supporting features that didn't make it. Everything makes sense, and nobody is at fault, but this stale-mate makes it very hard to move C++, as a language, forward. It also makes it hard to be sure that what we come up with in "200x" is a coherent language.

GCC could break this stale-mate by including experimental
implementations of these features. Then, the community at large can
experiment and better understand these features, finding (and fixing!)
problems before the ink dries on C++0x. At the end, we'll have a
better C++ language, and GCC will be well on its way to becoming the
first C++0x compiler.

As for variadic templates,  Benjamin rather understated an important
point with his comment, "A peek at tr1/tuple and tr1/functional will
explain my interest...."
The fact is that the implementations of the tuples and function
objects from the Library Technical Report (now part of the C++0x
Working Draft) are an utter and complete mess, and there's nothing
that we can do about it short of variadic templates. We have
hard-coded limits on the number of function parameters one can use
(10), but we can't increase these limits because the compile time
skyrockets [*]. Those limits are extremely frustrating for users. So
it's not just about about supporting C++0x, it's also about providing
a decent implementation of TR1 for users of GCC.

I've finished implementing a patch that replaces the current, ugly
implementation of Library TR1 in libstdc++ with one that uses variadic
templates exclusively. The preprocessor metaprogramming is all gone,
the implementation is much smaller, and it compiles much faster. I'll
post that patch, with a revised patch to the compiler, tomorrow
morning when I'm done testing it.

 Cheers,
 Doug

[*] See the chart I posted at
http://gcc.gnu.org/ml/gcc-patches/2006-09/png00000.png


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