Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2002-02-06 19:16:58


On Wednesday, February 6, 2002, at 06:44 PM,
brangdon_at_[hidden] wrote:

> In-Reply-To: <69857FD5-1A59-11D6-995A-003065D18932_at_[hidden]>
> On Tue, 5 Feb 2002 11:57:17 -0500 Howard Hinnant (hinnant_at_[hidden])
> wrote:
>> Yup! A minimum of 2 types of move are absolutely necessary:
>>
>> 1. Move construct.
>> 2. Move assign.
>>
>> One could argue that 2 more moves are useful:
>>
>> 3. Move construct, destructing the source.
>> 4. Move assign, destructing the source.
>
> Can you explain the semantics of these more explicitly? I don't
> understand
> why we need more than (3). (2) seems to be very similar to either swap()
> or plain operator=(). (1) seems to need to allocate and copy resources,
> so
> cannot be exception safe or especially efficient. (3) doesn't seem to
> offer much over swap() and destruct.
>
> To me (3) is only absolutely necessary one. What am I missing?

Please see my posts under the subject "move semantics" that address this
question. Sorry for switching subjects on you. I was trying not to
squelch progress on auto_vector.

-Howard


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