title: How to create an Eigen::Ref to a fixed-sized matrix row?
body: <p>I would like to write something like <code>foo4</code> similar to <code>foo3</code> in the Eigen::Ref doc <a href="http://eigen.tuxfamily.org/dox-devel/classEigen_1_1Ref.html" rel="nofollow noreferrer">here</a> :</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;Eigen/Dense&gt;
  
  using namespace Eigen;
  
  void foo3(Ref&lt;VectorXf, 0, Eigen::InnerStride&lt;&gt; &gt;){};
  void foo4(Ref&lt;Vector3f, 0, Eigen::InnerStride&lt;&gt; &gt;){};
  
  int main()
  {
    Eigen::Matrix3f fmat = Eigen::Matrix3f::Identity();
    Eigen::MatrixXf dmat = Eigen::Matrix3f::Identity();
  
    foo3(dmat.row(1)); // OK
  
    foo3(fmat.row(1)); // Error : YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES
    foo4(fmat.row(1)); // Error : YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES
  }
  </code></pre>
  <p>I'm using Eigen version 3.3.7</p>