Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-01-20 13:58:45


On Jan 20, 2004, at 10:16 AM, Peter Dimov wrote:

> 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

Thanks Peter. I'm following interestedly, but I'm several hours
behind...

-Howard


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