Boost C++ Libraries: Ticket #4417: boost\interprocess\file_mapping compilation errors https://svn.boost.org/trac10/ticket/4417 <p> Compilation errors with Visual Studio 2010: </p> <p> ...\ext_libs\boost\boost\interprocess\detail\move.hpp(358): error C2440: 'return' : cannot convert from 'boost::interprocess::file_mapping' to 'boost::interprocess::file_mapping &amp;&amp;' 1&gt; You cannot bind an lvalue to an rvalue reference 1&gt; ...\ext_libs\boost\boost\interprocess\file_mapping.hpp(62) : see reference to function template instantiation 'boost::interprocess::file_mapping &amp;&amp;boost::interprocess::move&lt;boost::interprocess::file_mapping&amp;&gt;(T)' being compiled 1&gt; with 1&gt; [ 1&gt; T=boost::interprocess::file_mapping &amp; 1&gt; ] 1&gt;...\ext_libs\boost\boost\interprocess\detail\move.hpp(358): error C2440: 'return' : cannot convert from 'boost::interprocess::mapped_region' to 'boost::interprocess::mapped_region &amp;&amp;' 1&gt; You cannot bind an lvalue to an rvalue reference 1&gt; ...\ext_libs\boost\boost\interprocess\mapped_region.hpp(159) : see reference to function template instantiation 'boost::interprocess::mapped_region &amp;&amp;boost::interprocess::move&lt;boost::interprocess::mapped_region&amp;&gt;(T)' being compiled 1&gt; with 1&gt; [ 1&gt; T=boost::interprocess::mapped_region &amp; 1&gt; ] 2&gt;...\filesystem\filesystem.h(39): warning C4018: '&lt;' : signed/unsigned mismatch 2&gt;...\filesystem\filesystem.h(52): warning C4018: '&lt;' : signed/unsigned mismatch 2&gt;...\ext_libs\boost\boost\interprocess\detail\move.hpp(358): error C2440: 'return' : cannot convert from 'boost::interprocess::file_mapping' to 'boost::interprocess::file_mapping &amp;&amp;' 2&gt; You cannot bind an lvalue to an rvalue reference 2&gt; ...\ext_libs\boost\boost\interprocess\file_mapping.hpp(62) : see reference to function template instantiation 'boost::interprocess::file_mapping &amp;&amp;boost::interprocess::move&lt;boost::interprocess::file_mapping&amp;&gt;(T)' being compiled 2&gt; with 2&gt; [ 2&gt; T=boost::interprocess::file_mapping &amp; 2&gt; ] 2&gt;...\ext_libs\boost\boost\interprocess\detail\move.hpp(358): error C2440: 'return' : cannot convert from 'boost::interprocess::mapped_region' to 'boost::interprocess::mapped_region &amp;&amp;' 2&gt; You cannot bind an lvalue to an rvalue reference 2&gt; ...\ext_libs\boost\boost\interprocess\mapped_region.hpp(159) : see reference to function template instantiation 'boost::interprocess::mapped_region &amp;&amp;boost::interprocess::move&lt;boost::interprocess::mapped_region&amp;&gt;(T)' being compiled 2&gt; with 2&gt; [ 2&gt; T=boost::interprocess::mapped_region &amp; 2&gt; ] </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4417 Trac 1.4.3 anonymous Sat, 10 Jul 2010 15:24:31 GMT <link>https://svn.boost.org/trac10/ticket/4417#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4417#comment:1</guid> <description> <p> Solution: </p> <p> +++ boost/interprocess/detail/move.hpp @@ -355,7 +355,7 @@ </p> <blockquote> <p> #else template &lt;class T&gt; inline typename remove_reference&lt;T&gt;::type&amp;&amp; move(T&amp;&amp; t) </p> </blockquote> <p> -{ return t; } +{ return static_cast&lt;typename remove_reference&lt;T&gt;::type&amp;&amp;&gt;(t); } </p> <blockquote> <p> #endif </p> </blockquote> <p> </p> <blockquote> <p> <em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em></em><em> </em></p> </blockquote> <p> @@ -968,4 +968,4 @@ </p> <blockquote> <p> INTERPROCESS_NAMESPACE_END } <em>namespace boost { </em></p> </blockquote> <p> -#endif <em>#ifndef BOOST_MOVE_HPP +#endif </em>#ifndef BOOST_MOVE_HPP </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 26 Aug 2010 10:28:41 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/4417#comment:2 https://svn.boost.org/trac10/ticket/4417#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> Fixed for Boost 1.45 in release branch </p> Ticket Ion Gaztañaga Thu, 26 Aug 2010 10:35:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4417#comment:3 https://svn.boost.org/trac10/ticket/4417#comment:3 <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> Ticket