From 3e95609cd4f036ccb647f9a590062cdb250e9760 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 1 Jun 2010 09:01:39 -0400 Subject: Backed out changeset 641d968a9a7ed57a3b8a3f45dea43c5ee6717f97 --- Eigen/src/Core/ReturnByValue.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Eigen/src/Core/ReturnByValue.h') diff --git a/Eigen/src/Core/ReturnByValue.h b/Eigen/src/Core/ReturnByValue.h index b2e581c70..986bab54d 100644 --- a/Eigen/src/Core/ReturnByValue.h +++ b/Eigen/src/Core/ReturnByValue.h @@ -36,9 +36,9 @@ struct ei_traits > enum { // We're disabling the DirectAccess because e.g. the constructor of // the Block-with-DirectAccess expression requires to have a coeffRef method. - // FIXME this should be fixed so we can have DirectAccessBit here. + // Also, we don't want to have to implement the stride stuff. Flags = (ei_traits::ReturnType>::Flags - | EvalBeforeNestingBit | EvalBeforeAssigningBit) & ~DirectAccessBit + | EvalBeforeNestingBit) & ~DirectAccessBit }; }; @@ -83,11 +83,8 @@ template template Derived& DenseBase::operator=(const ReturnByValue& other) { - // since we're by-passing the mechanisms in Assign.h, we implement here the EvalBeforeAssigningBit. - // override by using .noalias(), see corresponding operator= in NoAlias. - typename Derived::PlainObject result(rows(), cols()); - other.evalTo(result); - return (derived() = result); + other.evalTo(derived()); + return derived(); } #endif // EIGEN_RETURNBYVALUE_H -- cgit v1.2.3