Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-01-20 10:16:31


Bronek Kozicki wrote:
> On Tue, 20 Jan 2004 15:37:08 +0100, Bronek Kozicki wrote:
>
>> ooops. move_ptr cannot be passed into sink function:
>
> and of course it is not implementation problem; it's just how move
> semantics is supposed to work, I think. Anyway it appears to be much
> less usable than auto_ptr with its flawed copy semantics :(

No, it's more usable. Ownership transfers from a named move_ptr are supposed
to be explicit:

    sink( pi ); // error, possibly unintended transfer
    sink( move(pi) ); // OK, Howard's preferred
    sink( pi.move() ); // I kind of like it better but it's not generic


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