aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/ReturnByValue.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-06-01 09:01:39 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-06-01 09:01:39 -0400
commit3e95609cd4f036ccb647f9a590062cdb250e9760 (patch)
tree528103ec93fdfe883333270b3ec6c2a014391279 /Eigen/src/Core/ReturnByValue.h
parent641d968a9a7ed57a3b8a3f45dea43c5ee6717f97 (diff)
Diffstat (limited to 'Eigen/src/Core/ReturnByValue.h')
-rw-r--r--Eigen/src/Core/ReturnByValue.h11
1 files changed, 4 insertions, 7 deletions
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<ReturnByValue<Derived> >
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<typename ei_traits<Derived>::ReturnType>::Flags
- | EvalBeforeNestingBit | EvalBeforeAssigningBit) & ~DirectAccessBit
+ | EvalBeforeNestingBit) & ~DirectAccessBit
};
};
@@ -83,11 +83,8 @@ template<typename Derived>
template<typename OtherDerived>
Derived& DenseBase<Derived>::operator=(const ReturnByValue<OtherDerived>& 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