Subject: Re: [boost] [utility] Adding noexcept to boost::declval
From: Michel Morin (mimomorin_at_[hidden])
Date: 2012-03-26 21:19:04
Vicente J. Botet Escriba wrote
>> 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
You shouldn't do this, because this transforms rvalues to lvalues.
> I have rolled back at revision 77562.
Minor issue: `#include <boost/type_traits/add_lvalue_reference.hpp>` is
not removed yet.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk