Boost C++ Libraries: Ticket #6208: try_lock_wrapper swap compiler error on clang 3.0 c++11 https://svn.boost.org/trac10/ticket/6208 <p> While runing the regression test on clang-3.0/2.9 c++11 the following compile error appears </p> <pre class="wiki">clang-darwin.compile.c++ ../../../bin.v2/libs/thread/test/test_lock_concept.test/clang-darwin-2.9x/debug/threading-multi/test_lock_concept.o In file included from test_lock_concept.cpp:8: In file included from ../../../boost/thread/mutex.hpp:16: In file included from ../../../boost/thread/pthread/mutex.hpp:12: ../../../boost/thread/locks.hpp:991:15: error: base class 'unique_lock&lt;boost::mutex&gt;' has private copy constructor class try_lock_wrapper: ^ In file included from test_lock_concept.cpp:6: In file included from ../../../boost/test/unit_test.hpp:20: In file included from ../../../boost/test/unit_test_suite.hpp:21: In file included from ../../../boost/test/tree/test_case_template.hpp:31: In file included from ../../../boost/mpl/for_each.hpp:28: In file included from ../../../boost/utility/value_init.hpp:30: In file included from ../../../boost/swap.hpp:10: ../../../boost/utility/swap.hpp:33:5: note: in instantiation of function template specialization 'std::swap&lt;boost::detail::try_lock_wrapper&lt;boost::mutex&gt; &gt;' requested here swap(left,right); ^ ../../../boost/utility/swap.hpp:51:5: note: in instantiation of function template specialization 'boost_swap_impl::swap_impl&lt;boost::detail::try_lock_wrapper&lt;boost::mutex&gt; &gt;' requested here ::boost_swap_impl::swap_impl(left, right); ^ test_lock_concept.cpp:394:9: note: in instantiation of function template specialization 'boost::swap&lt;boost::detail::try_lock_wrapper&lt;boost::mutex&gt;, boost::detail::try_lock_wrapper&lt;boost::mutex&gt; &gt;' requested here swap(l1,l2); ^ test_lock_concept.cpp:453:5: note: in instantiation of member function 'test_locks_can_be_swapped&lt;boost::mutex, boost::detail::try_lock_wrapper&lt;boost::mutex&gt; &gt;::operator()' requested here test_locks_can_be_swapped&lt;Mutex,Lock&gt;()(); </pre><p> This is a similar problem to the one in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6207" title="#6207: Bugs: shared_lock swap compiler error on clang 3.0 c++11 (closed: fixed)">#6207</a>. The solution is </p> <pre class="wiki"> #ifndef BOOST_NO_RVALUE_REFERENCES template&lt;typename Mutex&gt; void swap(try_lock_wrapper&lt;Mutex&gt;&amp;&amp; lhs,try_lock_wrapper&lt;Mutex&gt;&amp;&amp; rhs) { lhs.swap(rhs); } template&lt;typename Mutex&gt; void swap(try_lock_wrapper&lt;Mutex&gt;&amp; lhs,try_lock_wrapper&lt;Mutex&gt;&amp; rhs) { lhs.swap(rhs); } #else template&lt;typename Mutex&gt; void swap(try_lock_wrapper&lt;Mutex&gt;&amp; lhs,try_lock_wrapper&lt;Mutex&gt;&amp; rhs) { lhs.swap(rhs); } #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6208 Trac 1.4.3 viboes Sun, 04 Dec 2011 14:59:24 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6208#comment:1 https://svn.boost.org/trac10/ticket/6208#comment:1 <ul> <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">fixed</span> </li> </ul> <p> Committed in trunk revision 75801. </p> Ticket viboes Sun, 04 Dec 2011 15:02:22 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/6208#comment:2 https://svn.boost.org/trac10/ticket/6208#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Let close it when the merge is done. </p> Ticket viboes Sat, 07 Jan 2012 22:58:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6208#comment:3 https://svn.boost.org/trac10/ticket/6208#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Committed in release at <a class="missing ticket">#76291</a> </p> Ticket