[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread piotr dot wyderski at gmail dot com
--- Comment #15 from piotr dot wyderski at gmail dot com 2009-04-07 15:47 --- Subject: Re: std::result_of doesn't work jwakely dot gcc at gmail dot com : > You want this: > > typename std::result_of< decltype(&traits::restore) (S*) >::type Thank you! :-) > Paolo, let's close this.

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #14 from paolo dot carlini at oracle dot com 2009-04-07 15:45 --- Agreed ;) -- paolo dot carlini at oracle dot com changed: What|Removed |Added S

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread jwakely dot gcc at gmail dot com
--- Comment #13 from jwakely dot gcc at gmail dot com 2009-04-07 15:42 --- (In reply to comment #12) > typename std::result_of< decltype(&traits::restore) (S*) >::type Oops, that should be S& not S* It's not perfect, but for this case std::result_of works if you get the syntax right :

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread jwakely dot gcc at gmail dot com
--- Comment #12 from jwakely dot gcc at gmail dot com 2009-04-07 15:40 --- See what I wrote at http://gcc.gnu.org/ml/libstdc++/2008-09/msg00124.html under point 3) You want this: typename std::result_of< decltype(&traits::restore) (S*) >::type Paolo, let's close this. -- http://

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread piotr dot wyderski at gmail dot com
--- Comment #11 from piotr dot wyderski at gmail dot com 2009-04-07 15:02 --- Subject: Re: std::result_of doesn't work 2009/4/7 jwakely dot gcc at gmail dot com : > what you probably want is: In fact I want to copy the return type of a template method restore and use as another meth

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #10 from paolo dot carlini at oracle dot com 2009-04-07 14:56 --- Gosh, thanks Jonathan for the explanation, the key word for me is *overloading*, if overloading were not part of C++ these facilities would probably be more "intuitive" to use. Agreed, let's give Piotr two min

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread jwakely dot gcc at gmail dot com
--- Comment #9 from jwakely dot gcc at gmail dot com 2009-04-07 14:51 --- This is not a bug in C++0x either. The spec is: Given an rvalue fn of type Fn and values t1, t2, ..., tN of types T1, T2, ..., TN in ArgTypes, respectively, the type member is the result type of the expression f

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #8 from paolo dot carlini at oracle dot com 2009-04-07 14:47 --- Yes, that would work, we even have testcases for it. But what about C++0x, Jonathan? Seems strange that only that more convoluted syntax is right... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39676

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread jwakely dot gcc at gmail dot com
--- Comment #7 from jwakely dot gcc at gmail dot com 2009-04-07 14:45 --- I think you have the syntax wrong, if you want to know the return type of a function type (or function pointer, or function reference) you need to say: result_of::type what you probably want is: typedef int

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #6 from paolo dot carlini at oracle dot com 2009-04-07 14:34 --- Yes, a purely unimplemented C++0x feature. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39676

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread piotr dot wyderski at gmail dot com
--- Comment #5 from piotr dot wyderski at gmail dot com 2009-04-07 14:31 --- So it is a purely C++0x bug, as you indicated in your first reply. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39676

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #4 from paolo dot carlini at oracle dot com 2009-04-07 14:15 --- I'm looking at 3.4/3 in n1836, and my answer is *no*. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39676

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #3 from paolo dot carlini at oracle dot com 2009-04-07 14:11 --- Are you *really* sure the simplified testcase was supposed to work per the TR1 specifications? The author of thar code is Doug Gregor, and it never did in GCC. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?i

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread piotr dot wyderski at gmail dot com
--- Comment #2 from piotr dot wyderski at gmail dot com 2009-04-07 14:05 --- (In reply to comment #1) > Note that *most* of the facilities in are still following the TR1 > specifications, thus, in general, do not expect conformance to the latest > C++0x > draft (or file a DR for each

[Bug libstdc++/39676] std::result_of doesn't work

2009-04-07 Thread paolo dot carlini at oracle dot com
--- Comment #1 from paolo dot carlini at oracle dot com 2009-04-07 13:19 --- Note that *most* of the facilities in are still following the TR1 specifications, thus, in general, do not expect conformance to the latest C++0x draft (or file a DR for each unimplemented behavior ;) --