Boost C++ Libraries: Ticket #10002: No swap for mapped_vector::reference https://svn.boost.org/trac10/ticket/10002 <p> Hi. </p> <p> When compiling the following code </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/numeric/ublas/lu.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/numeric/ublas/matrix.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/numeric/ublas/vector_sparse.hpp&gt;</span><span class="cp"></span> <span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">matrix</span><span class="o">&lt;</span><span class="kt">double</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">m</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">permutation_matrix</span><span class="o">&lt;</span><span class="kt">unsigned</span> <span class="kt">long</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">pm</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">mapped_vector</span><span class="o">&lt;</span><span class="kt">double</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">v</span><span class="p">)</span> <span class="p">{</span> <span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">lu_substitute</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">pm</span><span class="p">,</span> <span class="n">v</span><span class="p">);</span> <span class="p">}</span> </pre></div></div><p> with gcc 4.7 on linux, I get a compile error which at its core has </p> <p> /usr/include/boost/numeric/ublas/lu.hpp:71:17: error: no matching function for call to ‘swap(boost::numeric::ublas::mapped_vector&lt;double&gt;::reference, boost::numeric::ublas::mapped_vector&lt;double&gt;::reference)’ </p> <p> Shouldn't this be an allowed use of the classes involved? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10002 Trac 1.4.3