This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++ PATCH] TR1 'function' and 'mem_fn' support
- From: Chris Jefferson <caj at cs dot york dot ac dot uk>
- To: Douglas Gregor <dgregor at cs dot indiana dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 26 Jan 2005 15:29:26 +0000
- Subject: Re: [libstdc++ PATCH] TR1 'function' and 'mem_fn' support
- References: <200501260202.47184.dgregor@cs.indiana.edu>
Douglas Gregor wrote:
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:
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01627.html
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.
In addition to the patch and changelog, I've attached the two new test cases
(.cc files). I was unable to find a way to get them into a patch, because
they should be placed in a directory that does not yet exist
(libstdc++-v3/testsuite/tr1/3_function_objects, e.g.).
Comments appreciated.
Douglas Gregor
It all looks reasonable at first glance to me :)
If you enjoy and are good at template-foo, then you might like to note
that the reference_wrapper, also in tr1/functional, isn't actually
finished (I wrote the current version when it was just a tiny part of
the tuple specification. Then it sprouted a bunch of things about
executing functions, and I got scared off)...
Chris