Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-02-09 10:55:52


Daniel Wallin <dalwan01_at_[hidden]> writes:

>> One thing I think we overlooked in the move proposal, though, is the
>> fact that "only movable and not copyable" class rvalues *still* can't
>> legally be passed where a const reference is expected, unless the rule
>> in question is lifted. That seems like a problem to me.
>
> That is true if the class would declare regular move constructors with
> rvalue references. But doesn't the trick used to implement move_ptr
> apply with the new rvalue references as well? (moving with const&
> constructor)
>
> http://tinyurl.com/3f6sw
>
> X x;
> X y(static_cast<X&&>(x)); // should bind to X(X const&) and not
> // generate an error?
>
> So technically the rule doesn't need to be lifted if we get rvalue
> references.

OK, you're right.
But that's really awful. :(.

-- 
Dave Abrahams
Boost Consulting
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