Boost logo

Boost Users :

Subject: Re: [Boost-users] Weird problem with boost::noncopyable and boost::mutex
From: Igor R (boost.lists_at_[hidden])
Date: 2010-03-18 10:02:43


> You were right.
> Actually ObjectA has a member that is ListObject that has a member
> boost::mutex.
> I really need to use this objects this way and the LisObject object needs
> that mutex, is any other way I can use them and not recesive this problem?
> Thanks!!

You can either store [smart] pointer to the object, like Ovanes
proposed, or make your ObjectA copyable by storing [smart]ptrs to
non-copyable members. In the latter case you have to think how ObjectA
internals should be copied in the copy-constructor and operator=().


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net