title: Boost 1.48.0 upgrade_to_unique_lock on Linux: Has something changed since 1.47 or I do something wrong?
body: <p>I have a small <a href="http://code.google.com/p/cloudobserver/source/browse/trunk/CloudServer/src/cf-fs/fs_map.cpp" rel="nofollow">cpp source</a> and <a href="http://code.google.com/p/cloudobserver/source/browse/trunk/CloudServer/src/cf-fs/fs_map.h" rel="nofollow">h source</a> files with some class. It uses <a href="http://www.boost.org/doc/libs/1_48_0/doc/html/thread.html" rel="nofollow">shared mutexes and shared locks</a>. It compiles on windows with no errors with boost 1.48.0. It also compiled on linux (with boost 1.47 before). But now having code like this:</p>
  
  <pre><code> boost::shared_mutex mut_;
   //...
   boost::upgrade_lock&lt;boost::shared_mutex&gt; lock(mut_);
   boost::upgrade_to_unique_lock&lt;boost::shared_mutex&gt; uniqueLock(lock);
  </code></pre>
  
  <p>results in strange errors:</p>
  
  <pre><code>==== Building cf-fs (debug) ====
  Creating bin/obj/Debug/cf-fs
  fs_concurrent_queued_map.cpp
  fs_map.cpp
  In file included from ../../src/cf-util/http_utils_inl.h:1,
                   from ../../src/cf-util/http_utils.h:104,
                   from ../../src/cf-fs/fs_map.h:13,
                   from ../../src/cf-fs/fs_map.cpp:1:
  ../../src/cf-util/http_utils.h:105:8: warning: extra tokens at end of #endif directive
  In file included from ../../src/cf-fs/fs_map.h:13,
                   from ../../src/cf-fs/fs_map.cpp:1:
  ../../src/cf-util/http_utils.h:105:8: warning: extra tokens at end of #endif directive
  In file included from ../../../boost_libraries/install-dir/include/boost/thread/pthread/mutex.hpp:12,
                   from ../../../boost_libraries/install-dir/include/boost/thread/mutex.hpp:16,
                   from ../../../boost_libraries/install-dir/include/boost/thread/pthread/thread_data.hpp:12,
                   from ../../../boost_libraries/install-dir/include/boost/thread/thread.hpp:17,
                   from ../../../boost_libraries/install-dir/include/boost/thread.hpp:13,
                   from ../../src/cf-fs/fs_map.h:10,
                   from ../../src/cf-fs/fs_map.cpp:1:
  ../../../boost_libraries/install-dir/include/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]’:
  ../../src/cf-fs/fs_map.cpp:33:   instantiated from here
  ../../../boost_libraries/install-dir/include/boost/thread/locks.hpp:926: error: call of overloaded ‘move(boost::upgrade_lock&lt;boost::shared_mutex&gt;&amp;)’ is ambiguous
  ../../../boost_libraries/install-dir/include/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_libraries/install-dir/include/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_libraries/install-dir/include/boost/thread/locks.hpp: In destructor ‘boost::upgrade_to_unique_lock&lt;Mutex&gt;::~upgrade_to_unique_lock() [with Mutex = boost::shared_mutex]’:
  ../../src/cf-fs/fs_map.cpp:33:   instantiated from here
  ../../../boost_libraries/install-dir/include/boost/thread/locks.hpp:932: error: call of overloaded ‘move(boost::unique_lock&lt;boost::shared_mutex&gt;&amp;)’ is ambiguous
  ../../../boost_libraries/install-dir/include/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_libraries/install-dir/include/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;]
  make[1]: *** [bin/obj/Debug/cf-fs/fs_map.o] Ошибка 1
  make: *** [cf-fs] Ошибка 2
  </code></pre>
  
  <p>Do I have something wrong in my code that shall not compile and how to fix it or get around it?</p>