|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-09-17 10:10:19
Neal Becker <ndbecker2_at_[hidden]> writes:
> David Abrahams wrote:
>
>> "Neal D. Becker" <nbecker_at_[hidden]> writes:
>>
>>> This handy little item, lvalue_cast, would make a useful addition to
>>> boost. I didn't write it, and I don't recall who did.
>>
>> The problem with that is that casting away the const on a const rvalue
>> is sometimes unsafe. See the original move semantics proposal for
>> details.
>>
>
> Not sure what you're saying here. I agree it can sometimes be unsafe.
> That's why you shouldn't use it - except when you really want to. Isn't
> that consistent with the move semantics proposal?
No. Nothing in the move semantics proposal suggests that the
constness of a const rvalue should be removed. It only changes const
rvalues into const lvalues.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk