
"vicente.botet" <vicente.botet@wanadoo.fr> 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 -- 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