[Boost-bugs] [Boost C++ Libraries] #6170: boost::move conflicts in thread upgrade mutexes (1.48.0)

Subject: [Boost-bugs] [Boost C++ Libraries] #6170: boost::move conflicts in thread upgrade mutexes (1.48.0)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-23 23:59:56


#6170: boost::move conflicts in thread upgrade mutexes (1.48.0)
----------------------------------+-----------------------------------------
 Reporter: nathan@… | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost 1.48.0 | Severity: Regression
 Keywords: |
----------------------------------+-----------------------------------------
 Due to the new boost::move package, you can no longer use upgradeable
 locks and unordered_map at the same time, you get ambiguous function
 names:

 Compiling the file:
 {{{
 #include <boost/thread/shared_mutex.hpp>
 #include <boost/thread/locks.hpp>

 // Including this will cause ambiguous errors in boost::move
 #include <boost/unordered_map.hpp>

 using namespace boost;

 typedef upgrade_lock<shared_mutex> auto_upgrade_lock;
 typedef upgrade_to_unique_lock<shared_mutex> auto_upgrade_unique_lock;

 void testUpgrade(void);

 void testUpgrade(void)
 {
         shared_mutex mtx;
         auto_upgrade_lock lock(mtx);
         // Do some read-only stuff

         auto_upgrade_unique_lock writeLock(lock);
         // Do some write-only stuff with the upgraded lock
 }
 }}}

 Yields the following error:
 {{{
 boost/thread/locks.hpp: In constructor
 â€˜boost::upgrade_to_unique_lock<Mutex>::upgrade_to_unique_lock(boost::upgrade_lock<Mutex>&)
 [with Mutex = boost::shared_mutex]’:
 test.cpp:23: instantiated from here
 boost/thread/locks.hpp:926: error: call of overloaded
 â€˜move(boost::upgrade_lock<boost::shared_mutex>&)’ is ambiguous
 boost/thread/detail/move.hpp:44: note: candidates are: typename
 boost::enable_if<boost::is_convertible<T&, boost::detail::thread_move_t<T>
>, boost::detail::thread_move_t<T> >::type boost::move(T&) [with T =
 boost::upgrade_lock<boost::shared_mutex>]
 boost/move/move.hpp:294: note: typename
 boost::move_detail::disable_if<boost::has_move_emulation_enabled<T>,
 T&>::type boost::move(T&) [with T =
 boost::upgrade_lock<boost::shared_mutex>]
 boost/thread/locks.hpp: In destructor
 â€˜boost::upgrade_to_unique_lock<Mutex>::~upgrade_to_unique_lock() [with
 Mutex = boost::shared_mutex]’:
 test.cpp:23: instantiated from here
 boost/thread/locks.hpp:932: error: call of overloaded
 â€˜move(boost::unique_lock<boost::shared_mutex>&)’ is ambiguous
 boost/thread/detail/move.hpp:44: note: candidates are: typename
 boost::enable_if<boost::is_convertible<T&, boost::detail::thread_move_t<T>
>, boost::detail::thread_move_t<T> >::type boost::move(T&) [with T =
 boost::unique_lock<boost::shared_mutex>]
 boost/move/move.hpp:294: note: typename
 boost::move_detail::disable_if<boost::has_move_emulation_enabled<T>,
 T&>::type boost::move(T&) [with T =
 boost::unique_lock<boost::shared_mutex>]
 }}}

 Compiling using 1.48.0 on OSX.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6170>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC