From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-05-08 10:38:33
Frank Mori Hess <frank.hess_at_[hidden]> writes:
> On Thursday 08 May 2008 10:03 am, Peter Dimov wrote:
>> It does have a default constructor. Movable types have to have an "empty"
>> state in which to put the moved-from source, and the default constructor of
>> a movable type usually creates such an "empty" object. (The proposed
>> promise doesn't adhere to this "convention" though.)
> My recollection is that the requirements are looser: a move can leave the
> moved-from source in any state it likes as long as it doesn't violate any of
> the class' specified invariants.
That's the requirement, but what Peter describes is the typical implementation
for a move-only type. If unique_lock left the source holding the lock too then
it wouldn't be unique any more, and everything would go wrong.
Moving from a boost::unique_lock has always left the source empty
(l.mutex()==NULL). The newly-added default constructor allows you to start
with it like that.
-- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk