This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++ patch] TR1 result_of implementation
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Douglas Gregor <doug dot gregor at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 28 Feb 2005 01:14:32 +0100
- Subject: Re: [libstdc++ patch] TR1 result_of implementation
- References: <200502271542.19205.doug.gregor@gmail.com>
Douglas Gregor wrote:
This patch adds support for result_of (section 3.4 of TR1). This is the
library-only solution that does not make sure of typeof. If we get a
reference-preserving typeof (or can fake it), we should consider replacing
this implementation with one that uses the reference-preserving typeof
directly.
Yes, this issue - reference-preserving typeof - already surfaced a bit
in the past, but I'm a little confused about the expected developments:
is there someone actually working on it?!? Gaby should know better...
All function object tests pass on i686-pc-linux-gnu; full test suite is
running right. Okay to commit if everything passes?
You have my personal ok (of course wait 1-2 days for the other
maintainers), modulo a curiosity:
+ template<typename _Tp>
+ class _Has_result_type_helper
+ {
+ template<typename _Up>
+ struct _Wrap_type
+ { };
+
+ template<typename _Up>
+ static __sfinae_types::__one
+ __test(_Wrap_type<typename _Up::result_type>*);
+
+ template<typename _Up>
+ static __sfinae_types::__two __test(...);
+
+ public:
+ static const bool __value = sizeof(__test<_Tp>(0)) == 1;
+ };
Is there something wrong with deriving from __sfinae_types, as I'm
usually doing?!?
Also, watch-out for overlong lines, maybe you have got a couple...
Paolo.