This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [libstdc++ PATCH] TR1 'function' and 'mem_fn' support


> 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

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. 

Bummer.

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
then. 

> 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.

I think this looks great. Thanks for this work! I'm ok with this going in as-is, as soon as your assignment becomes active.

-benjamin


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