mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Even ReturnByValue should not evaluate when assembling the expression
This commit is contained in:
parent
da6ec81282
commit
2bf63c6b4a
@ -33,6 +33,7 @@ struct traits<ReturnByValue<Derived> >
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef EIGEN_TEST_EVALUATORS
|
||||||
/* The ReturnByValue object doesn't even have a coeff() method.
|
/* The ReturnByValue object doesn't even have a coeff() method.
|
||||||
* So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix.
|
* So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix.
|
||||||
* So internal::nested always gives the plain return matrix type.
|
* So internal::nested always gives the plain return matrix type.
|
||||||
@ -44,6 +45,13 @@ struct nested<ReturnByValue<Derived>, n, PlainObject>
|
|||||||
{
|
{
|
||||||
typedef typename traits<Derived>::ReturnType type;
|
typedef typename traits<Derived>::ReturnType type;
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
template<typename Derived,int n,typename PlainObject>
|
||||||
|
struct nested_eval<ReturnByValue<Derived>, n, PlainObject>
|
||||||
|
{
|
||||||
|
typedef typename traits<Derived>::ReturnType type;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user