Boost logo

Boost Users :

Subject: Re: [Boost-users] Weird problem with boost::noncopyable and boost::mutex
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2010-03-18 09:47:32


On Thu, Mar 18, 2010 at 2:37 PM, Daniel V <dann.vd_at_[hidden]> wrote:

> 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!!
>
> Dann
>
You could use a pointer to your object, which is non-copyable and store the
pointer in the list than. If you decide to go that way consider using boost
pointer containers, which wrap pointer semantics and do automatic memory
management of contained pointers. Here is the lib ref:
http://www.boost.org/doc/libs/1_42_0/libs/ptr_container/doc/ptr_container.html

Regards,
Ovanes



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