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-17 19:00:42


> The thing is that I instanciated an ArrayList object and called the "insert"
> method and I received an error from boost::mutex AND boost::noncopyable!!
> and I am not using them at all!!
> This is the code that generates the error:
>         ArrayList<ObjectA> myArrayListA;
>         ObjectA myObjectA;
>         myArrayListA.insert(myObjectA);

Maybe ObjectA has a member of type boost::mutex?
insert() invokes compiler-generated copy-constructor of ObjectA, which
in turn tries to copy the mutex.
In short, you ObjectA is non-copyable.


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