This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] PATCH: PR 20599 (variadic templates, take two) (4/4)
- From: "Chris Jefferson" <chris at bubblescope dot net>
- To: "Douglas Gregor" <doug dot gregor at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 19 Sep 2006 16:45:38 +0100
- Subject: Re: [v3] PATCH: PR 20599 (variadic templates, take two) (4/4)
- References: <5EB0664C-175A-432B-83D6-92A8FB72AC47@cs.indiana.edu>
On 19/09/06, Douglas Gregor <doug.gregor@gmail.com> wrote:
This patch addresses PR c++/20599 by introducing support for variadic
templates:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20599
This is part 4 of 4. It contains changes to libstdc++'s TR1
implementation to make full use of variadic templates, eliminating
all of the preprocessor metaprogramming that we're using now.
I am only looking at the tuple code here (which is the only part I
have personal experience with). At first glance everything appears
very good.
I have one very, very minor point. The TR1 standard requires the
prototype for 'get' be:
template <int I, class T1, class T2, ..., class TN>
RJ get(tuple<T1, T2, ..., TN>& t);
whereas the prototype used here is involved in a (very clever) trick
to get an O(1) get. This could be fixed simply by wrapping get.
There is the general problem with this kind of code, which is that it
can generate a lot of very small functions which we can get in the way
of debugging and running code without optimisation. However, this is a
continuing problem with C++ and here I think the gains clearly
outweigh the losses.
Chris