|
Boost : |
From: Greer, Joe (jgreer_at_[hidden])
Date: 2007-04-17 08:45:38
> -----Original Message-----
> From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]]
> On Behalf Of Peter Dimov
> Sent: Tuesday, April 17, 2007 5:59 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] [shared_ptr] dangerous implementation of
> moveconstructor
>
>
> This is the essence of the discussion. :-) I think that efficiency is
more
> important in a move primitive than leaving the source in a predictable
> state, Joe argues the other way.
>
[Joe] Tossing in my own $.02, this Joe tends to agree somewhat with the
other Joe. :) If I wanted to swap p and q, I can do that today without
the move. On the other hand, if I move a value from q to p, I expect
p's contents to be gone, not to be transferred to q. Now, I could see
leaving q with old contents and flagged so it's destruction doesn't
cause a delete or some such. I think the semantics of the English word
'move' would make it very surprising to any user to have it do a swap
instead. Just my opinion.
joe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk