
27 Mar
2012
27 Mar
'12
1:19 a.m.
Vicente J. Botet Escriba wrote
Summary: Defining declval<T>() as add_lvalue_reference<T>::type is wrong; add_lvalue_reference should be removed!
There is something that disturb me by returning just T, doesn't this forces the type T to CopyConstructible?
Nope. T needs not to be CopyConstructible (Note that declval can be used only in unevaluated contexts.)
The idea to use T& instead was to avoid this.
You shouldn't do this, because this transforms rvalues to lvalues.
I have rolled back at revision 77562.
Thanks, Vicente! Minor issue: `#include <boost/type_traits/add_lvalue_reference.hpp>` is not removed yet. Regards, Michel