#include USING_PART_OF_NAMESPACE_EIGEN using namespace std; template Eigen::Row firstRow(MatrixBase& m) { return m.row(0); } int main(int, char**) { Matrix4d m = Matrix4d::identity(); cout << firstRow(m) << endl; firstRow(m) *= 5; cout << "Now the matrix m is:" << endl << m << endl; return 0; }