compiler error on using threads with boost

Hi, I get this compiler error : boost/thread/future.hpp", line 414: Error: Formal argument other of type boost::unique_lock<boost::mutex> in call to boost::unique_lock<boost::mutex>::operator=(boost::unique_lock<boost::mutex>) has an inaccessible copy constructor. Any idea why this is? I'm using the sun compiler to compile it with Regards, iskandar

On Mon, Mar 29, 2010 at 3:38 PM, Iskandar Prins <iprins@alphabay.nl> wrote:
Hi,
I get this compiler error :
boost/thread/future.hpp", line 414: Error: Formal argument other of type boost::unique_lock<boost::mutex> in call to boost::unique_lock<boost::mutex>::operator=(boost::unique_lock<boost::mutex>) has an inaccessible copy constructor.
Any idea why this is? I'm using the sun compiler to compile it with
Because unique_lock cannot be copied. Either pass it as reference or use shared_lock. Regards, Ovanes

I get the error when I only do: #include <boost/thread.hpp> From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ovanes Markarian Sent: Monday, March 29, 2010 15:47 To: boost-users@lists.boost.org Subject: Re: [Boost-users] compiler error on using threads with boost On Mon, Mar 29, 2010 at 3:38 PM, Iskandar Prins <iprins@alphabay.nl<mailto:iprins@alphabay.nl>> wrote: Hi, I get this compiler error : boost/thread/future.hpp", line 414: Error: Formal argument other of type boost::unique_lock<boost::mutex> in call to boost::unique_lock<boost::mutex>::operator=(boost::unique_lock<boost::mutex>) has an inaccessible copy constructor. Any idea why this is? I'm using the sun compiler to compile it with Because unique_lock cannot be copied. Either pass it as reference or use shared_lock. Regards, Ovanes

Additionally, you can move the unique_lock to transfer the ownership. Regards, Ovanes On Mon, Mar 29, 2010 at 3:46 PM, Ovanes Markarian <om_boost@keywallet.com>wrote:
On Mon, Mar 29, 2010 at 3:38 PM, Iskandar Prins <iprins@alphabay.nl>wrote:
Hi,
I get this compiler error :
boost/thread/future.hpp", line 414: Error: Formal argument other of type boost::unique_lock<boost::mutex> in call to boost::unique_lock<boost::mutex>::operator=(boost::unique_lock<boost::mutex>) has an inaccessible copy constructor.
Any idea why this is? I'm using the sun compiler to compile it with
Because unique_lock cannot be copied. Either pass it as reference or use shared_lock.
Regards, Ovanes

I get this error when I do the following. I haven't used any of the lock so far #include "boost/thread.hpp" int main(){ return 0; } From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ovanes Markarian Sent: Monday, March 29, 2010 15:55 To: boost-users@lists.boost.org Subject: Re: [Boost-users] compiler error on using threads with boost Additionally, you can move the unique_lock to transfer the ownership. Regards, Ovanes On Mon, Mar 29, 2010 at 3:46 PM, Ovanes Markarian <om_boost@keywallet.com<mailto:om_boost@keywallet.com>> wrote: On Mon, Mar 29, 2010 at 3:38 PM, Iskandar Prins <iprins@alphabay.nl<mailto:iprins@alphabay.nl>> wrote: Hi, I get this compiler error : boost/thread/future.hpp", line 414: Error: Formal argument other of type boost::unique_lock<boost::mutex> in call to boost::unique_lock<boost::mutex>::operator=(boost::unique_lock<boost::mutex>) has an inaccessible copy constructor. Any idea why this is? I'm using the sun compiler to compile it with Because unique_lock cannot be copied. Either pass it as reference or use shared_lock. Regards, Ovanes

On Mon, Mar 29, 2010 at 4:03 PM, Iskandar Prins <iprins@alphabay.nl> wrote:
I get this error when I do the following. I haven't used any of the lock so far
Which compiler (+version) and boost version do you use? On my MacOS X g++ 4.01 and boost 1.42 your example compiles without errors.

$CC -V CC: Sun C++ 5.10 SunOS_i386 2009/06/03 patched with 128229-06compiling on Solaris x64 From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ovanes Markarian Sent: Monday, March 29, 2010 16:36 To: boost-users@lists.boost.org Subject: Re: [Boost-users] compiler error on using threads with boost On Mon, Mar 29, 2010 at 4:03 PM, Iskandar Prins <iprins@alphabay.nl<mailto:iprins@alphabay.nl>> wrote: I get this error when I do the following. I haven't used any of the lock so far Which compiler (+version) and boost version do you use? On my MacOS X g++ 4.01 and boost 1.42 your example compiles without errors.

On Mar 29, 2010, at 8:02 AM, Ovanes Markarian wrote:
Unfortunately, I don't have access to Sun C++ compiler. Maybe someone else from the group???
On Mon, Mar 29, 2010 at 4:45 PM, Iskandar Prins <iprins@alphabay.nl> wrote: $CC -V
CC: Sun C++ 5.10 SunOS_i386 2009/06/03
patched with 128229-06compiling on Solaris x64
The wiki has a "platform champions" page <https://svn.boost.org/trac/boost/wiki/PlatformChampions> However, no one has volunteered to help support Sun^H^H^H OracleOS. -- Marshall

On 03/29/2010 09:18 AM, Marshall Clow wrote:
The wiki has a "platform champions" page <https://svn.boost.org/trac/boost/wiki/PlatformChampions> However, no one has volunteered to help support Sun^H^H^H OracleOS.
I'll volunteer for... what's the opposite of "Champion"? :-) Sun Studio is a rather poor C++ compiler. GCC is the better choice for C++ on Solaris.
participants (4)
-
Iskandar Prins
-
Marshall Clow
-
Ovanes Markarian
-
Rob Riggs