Boost C++ Libraries: Ticket #6170: boost::move conflicts in thread upgrade mutexes (1.48.0) https://svn.boost.org/trac10/ticket/6170 <p> 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: </p> <p> Compiling the file: </p> <pre class="wiki">#include &lt;boost/thread/shared_mutex.hpp&gt; #include &lt;boost/thread/locks.hpp&gt; // Including this will cause ambiguous errors in boost::move #include &lt;boost/unordered_map.hpp&gt; using namespace boost; typedef upgrade_lock&lt;shared_mutex&gt; auto_upgrade_lock; typedef upgrade_to_unique_lock&lt;shared_mutex&gt; 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 } </pre><p> Yields the following error: </p> <pre class="wiki">boost/thread/locks.hpp: In constructor ‘boost::upgrade_to_unique_lock&lt;Mutex&gt;::upgrade_to_unique_lock(boost::upgrade_lock&lt;Mutex&gt;&amp;) [with Mutex = boost::shared_mutex]’: test.cpp:23: instantiated from here boost/thread/locks.hpp:926: error: call of overloaded ‘move(boost::upgrade_lock&lt;boost::shared_mutex&gt;&amp;)’ is ambiguous boost/thread/detail/move.hpp:44: note: candidates are: typename boost::enable_if&lt;boost::is_convertible&lt;T&amp;, boost::detail::thread_move_t&lt;T&gt; &gt;, boost::detail::thread_move_t&lt;T&gt; &gt;::type boost::move(T&amp;) [with T = boost::upgrade_lock&lt;boost::shared_mutex&gt;] boost/move/move.hpp:294: note: typename boost::move_detail::disable_if&lt;boost::has_move_emulation_enabled&lt;T&gt;, T&amp;&gt;::type boost::move(T&amp;) [with T = boost::upgrade_lock&lt;boost::shared_mutex&gt;] boost/thread/locks.hpp: In destructor ‘boost::upgrade_to_unique_lock&lt;Mutex&gt;::~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&lt;boost::shared_mutex&gt;&amp;)’ is ambiguous boost/thread/detail/move.hpp:44: note: candidates are: typename boost::enable_if&lt;boost::is_convertible&lt;T&amp;, boost::detail::thread_move_t&lt;T&gt; &gt;, boost::detail::thread_move_t&lt;T&gt; &gt;::type boost::move(T&amp;) [with T = boost::unique_lock&lt;boost::shared_mutex&gt;] boost/move/move.hpp:294: note: typename boost::move_detail::disable_if&lt;boost::has_move_emulation_enabled&lt;T&gt;, T&amp;&gt;::type boost::move(T&amp;) [with T = boost::unique_lock&lt;boost::shared_mutex&gt;] </pre><p> Compiling using 1.48.0 on OSX. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6170 Trac 1.4.3 anonymous Thu, 24 Nov 2011 09:50:47 GMT <link>https://svn.boost.org/trac10/ticket/6170#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6170#comment:1</guid> <description> <p> It is similar to the <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6141" title="#6141: Bugs: Compilation error when boost.thread and boost.move are used together (closed: fixed)">#6141</a> ticket. </p> </description> <category>Ticket</category> </item> <item> <author>Nathan@…</author> <pubDate>Thu, 24 Nov 2011 15:43:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6170#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6170#comment:2</guid> <description> <p> It is exactly that issue. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 02 Dec 2011 21:01:23 GMT</pubDate> <title>status changed; cc, resolution set https://svn.boost.org/trac10/ticket/6170#comment:3 https://svn.boost.org/trac10/ticket/6170#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6141" title="#6141: Bugs: Compilation error when boost.thread and boost.move are used together (closed: fixed)">#6141</a> Compilation error when boost.thread and boost.move are used together </p> Ticket