This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: c++0x vs. tr1 type_traits, round 1
I think we may have a minor issue with the decay trait. Your
implementation of the spec looks correct, but the spec looks slightly
wrong. :-\
The decay<T> trait is supposed to model passing T by value. I.e.
these should behave identically:
template <class T> void foo(T); // #1
template <class T> void foo(typename decay<T>::type); // #2
As far as I know, if you pass a const type to #1 the const is not
deduced into T (please correct me if I'm wrong on that). So I think
the spec needs a remove_cv<U>::type in there for the non-array, non-
function case.
I've sent a note to Thorsten about this and if he agrees, we'll file
a DR to fix it. In the meantime, this is just a heads-up.
-Howard