Re: [eigen] Ref<> Problem |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
I give it a try: struct A{ // constructor does not generate a temporary: template<class Derived> A(const Eigen::MatrixBase<Derived> & in) : r(in) {} // initializing r might create a temporary but that is stored in r A & operator=(const A & other) { new (&r) Eigen::Ref<const Eigen::MatrixXd>(other.r); return *this; } Eigen::Ref<const Eigen::MatrixXd> r; }; Is that correct, it seems to work :-)? On 12/04/2014 10:18 AM, Gael Guennebaud
wrote:
|
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |