From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-05-03 16:50:00
"vicente.botet" <vicente.botet_at_[hidden]> writes:
> I'm defining a class that is non copiable but movable. The class contains a
> boost::mutex and boost::condition_variable fields which are non copiable
> neither movable. I'd prefere not been forced to allocate all the class data
> in a pointer to make possible the move operation.
These classes cannot be made movable without forcing an additional level of
indirection, since e.g. pthread_mutex_t is not movable.
I would imagine that it is unsafe to move an object if other threads might be
accessing it concurrently, since you will be moving the data that they are
referencing. If there are no other threads, then you can just construct a new
condition_variable or mutex in the destination.
-- 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