Opened 11 years ago
Closed 11 years ago
#6175 closed Bugs (fixed)
Compile error with SunStudio
Reported by: | anonymous | Owned by: | viboes |
---|---|---|---|
Milestone: | Boost 1.49.0 | Component: | thread |
Version: | Boost 1.48.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
Version of compiler: CC: Sun C++ 5.10 SunOS_sparc 2009/06/03
A compile error occurs with the above compiler when boost/thread.hpp is included:
"./boost/thread/future.hpp", line 422: Error: boost::unique_lock<boost::mutex>::operator=(boost::unique_lock<boost::mutex>&) is not accessible from boost::detail::future_waiter::all_futures_lock::all_futures_lock(std::vector<boost::detail::future_waiter::registered_waiter>&).
There is a patch for this issue in the mailinglist: http://lists.boost.org/Archives/boost/2011/03/179261.php
But it is still not committed.
Change History (5)
comment:1 by , 11 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 11 years ago
Cc: | removed |
---|---|
Milestone: | To Be Determined → Boost 1.49.0 |
In order to state clearly that this is a workaround I will use instead
#if defined __DECCXX || defined __SUNPRO_CC locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex).move(); #else locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex); #endif
Let me know if this works for you.
Committed in trunk revision 75788.
comment:3 by , 11 years ago
Yeah, it compiles with this workaround.
Is this a good workaround?
You could also change the visibility of unique_lock& operator=(unique_lock&) in boost/thread/locks.hpp to public.
I think the root of problem has something to do that the sun compiler does not support rvalue references. The define BOOST_NO_RVALUE_REFERENCES is set in boost/config/compiler/sunpro_cc.hpp.
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed in release at #76291
Please could you check if the following works in your configuration?
boost::move(locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex));