Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-07-29 15:13:07


on Tue Jul 29 2008, Steven Watanabe <watanabesj-AT-gmail.com> wrote:

>> It's
>> the same with regular empty objects: you have to make sure you do not
>> access them.
>>
>
> No it isn't the same. There are some operations that ought to be
> valid for any object, regardless of whether it is empty or not.
> In particular if an type supports assignment, it should /always/
> be safe to assign a new value to to an object of that type.

Technically, in general, anything moved-from only needs to be in a
destructible (and not assignable) state. However, a library can impose
whatever additional requirements it wants to, and that the object needs
to be assignable is certainly a reasonable (and useful) one.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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