This is the mail archive of the
mailing list for the GCC project.
Re: [libstdc++ PATCH] TR1 'function' and 'mem_fn' support
- From: Chris Jefferson <caj at cs dot york dot ac dot uk>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: Douglas Gregor <dgregor at cs dot indiana dot edu>, gcc-patches at gcc dot gnu dot org, libstdc++ <libstdc++ at gcc dot gnu dot org>, jason at redhat dot com
- Date: Wed, 26 Jan 2005 18:21:52 +0000
- Subject: Re: [libstdc++ PATCH] TR1 'function' and 'mem_fn' support
- References: <firstname.lastname@example.org> <email@example.com>
Benjamin Kosnik wrote:
I'm happy to adapt my tuple generation program to generate this header,
which would have the advantage it would remove of 10 on the maximum
size. Of course this leads to other problems which I'm not positive how
to fix.... but it seems like it's not impossible someone might hit the
10-parameter (I've seen functions with more, although not in very nice code)
The attached patch adds support for std::tr1::function and std::tr1::mem_fn to
libstdc++. The good news is that it implements the complete specification and
passes all of the existing libstdc++ tests (plus the two new tests) on x86
Linux. The bad news is that it only passes when using my (unreviewed) patch
for making member pointers work properly with function types, posted here:
Let's try to get this reviewed. Jason? You'd indicated a willingness to
prioritize TR1 work in Redmond. What do you think of this patch, and is
this something we can get into 4.0?
It is possible to work around the bugs fixed by that patch, but it's very,
very ugly and will require a lot of new code. As it is, any implementation of
these facilities requires a huge amount of repetition; in this case, I've
chosen to repeatedly include a header file, using macros to generate
different code each time.
Yes. I saw that.
I'm trying to think of a better way to do this, but cannot at the
moment. There's no way to avoid this kind of insanity without variadic
templates, or something like that.
I'm sure that if somebody comes up
with a great idea to do this without the macro hacks at some point in
the future, or with approved template extensions, we can discuss it