[eigen] Matrix::RowXpr::Nested is a reference...

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Is that correct as is?

In the following case

Replicated<MatrixXd::RowXpr,2,1>(matrix.row(0))

it means that it fails since matrix.row(0) returns a temporary to which a reference is stored in Replicate.

I used this piece of code to verify my assumption:

#include "Eigen/Core"

#include "boost/type_traits/is_reference.hpp"

void main()
{
  typedef Eigen::MatrixXd::RowXpr::Nested type;

  std::cout << typeid(type).name();
  if (boost::is_reference<type>::type::value == true) std::cout << "&";
  std::cout << std::endl;
}

Cheers,
Hauke


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/