Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-01-23 10:06:54


On Jan 22, 2004, at 11:09 PM, Jonathan Turkanis wrote:

> Here are some test cases. The ones marked error are cases I believe
> should not compile.
>
> struct Base { virtual ~Base() { } };
> struct Derived : Base { };
>
> inline void const_sink(const move_ptr<Base> p)
> {
> /*[1]*/ move_ptr<Base> p2 = p; // ???
> }
>
> VC7.1, GCC 3.2 and como 4.3.3 reject 1, while Codewarrior accepts it.
> I think it should fail to compile. Correct? It seems to be the only
> case where the cant_move_from_const makes any difference.

I agree that [1] should not compile. You don't want to move from an
lvalue with copy syntax, especially a const lvalue.

-Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk