title: Want to write a C++ wrapper for ublas' project function
body: <p>Minimal code example:</p>
  
  <pre><code>#include &lt;boost/numeric/ublas/matrix_proxy.hpp&gt;
  
  namespace bnu = boost::numeric::ublas;
  
  template&lt;class M, class IA&gt;
  bnu::matrix_indirect&lt;M, IA&gt; project (bnu::matrix_indirect&lt;M, IA&gt; &amp;data,
      int row1, int row2, int col1, int col2) {
      return bnu::project(data,
          bnu::range(row1, row2), bnu::range(col1, col2));
  }
  
  #include &lt;boost/numeric/ublas/matrix.hpp&gt;
  
  int main()
  {
      bnu::matrix&lt;int&gt; m(4,4);
      project(m,0,1,0,1);
      return 0;
  }
  </code></pre>
  
  <p>Compile like this:</p>
  
  <pre><code>g++ -Wall project.cpp -o project
  </code></pre>
  
  <p>It raises a compiler error:</p>
  
  <pre><code>&gt; g++ -Wall project.cpp -o project
  project.cpp: In function ‘int main()’:
  project.cpp:16:19: error: no matching function for call to ‘project(boost::numeric::ublas::matrix&lt;int&gt;&amp;, int, int, int, int)’
  project.cpp:16:19: note: candidates are:
  project.cpp:7:29: note: template&lt;class M, class IA&gt; boost::numeric::ublas::matrix_indirect&lt;M, IA&gt; project(boost::numeric::ublas::matrix_indirect&lt;M, IA&gt;&amp;, int, int, int, int)
  project.cpp:7:29: note:   template argument deduction/substitution failed:
  project.cpp:16:19: note:   ‘boost::numeric::ublas::matrix&lt;int&gt;’ is not derived from ‘boost::numeric::ublas::matrix_indirect&lt;M, IA&gt;’
  (more candidates to come, but these are not important here)
  </code></pre>
  
  <p>I guess my header for my version of <code>project</code> was not fitting (I copied the best suitable from <code>/usr/include/boost/numeric/ublas/matrix_proxy.hpp</code>). How to make it work?</p>