2012/10/24 Marc Glisse <marc.gli...@inria.fr>: > On Wed, 24 Oct 2012, Paolo Carlini wrote: > >> let's try again ;) In the light of discussion in Portland, which liked >> Marc's idea of using std::decay in the unary common_type too, the below >> seems good to go now, given that there are bad interactions with the >> front-end bug we have got. > > > template<typename _Tp> > struct common_type<_Tp> > - { typedef _Tp type; }; > + { typedef typename decay<_Tp>::type type; }; > > (talking to myself) > I guess decay never has sfinae-type errors, so it doesn't matter whether we > have this typedef or derive from decay.
Depending on the final resolution of http://cplusplus.github.com/LWG/lwg-active.html#2101 (the worst IMO) std::decay could produce an invalid instantiation, a less aggressive variant would make this sfinae-friendly (not type), but hopefully it will always be well-formed. I'm awaiting the further development of that issue. - Daniel