aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Core/Product.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-10-15 05:56:21 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-10-15 05:56:21 +0000
commit884a718b0a2faad2e34cd916704cbc6c2a23550e (patch)
treeede4aca3c0ea94364932cfb740cbb7ceb2c2c928 /src/Core/Product.h
parentf355ef2df0f51fc80565285a907f48925a554505 (diff)
make shameless use of const_cast to reduce code redundancy. This means Eigen2
gives up enforcing constness. I really tried to enforce it, but it really was much hassle because our expression templates can be lvalues (not only rvalues) and so much code had to be written twice.
Diffstat (limited to 'src/Core/Product.h')
-rw-r--r--src/Core/Product.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Core/Product.h b/src/Core/Product.h
index 29b11b74d..854816a71 100644
--- a/src/Core/Product.h
+++ b/src/Core/Product.h
@@ -66,8 +66,8 @@ template<typename Lhs, typename Rhs> class Product
{
public:
typedef typename Lhs::Scalar Scalar;
- typedef typename Lhs::ConstRef LhsRef;
- typedef typename Rhs::ConstRef RhsRef;
+ typedef typename Lhs::Ref LhsRef;
+ typedef typename Rhs::Ref RhsRef;
friend class Object<Scalar, Product>;
static const int RowsAtCompileTime = Lhs::RowsAtCompileTime,
@@ -86,7 +86,6 @@ template<typename Lhs, typename Rhs> class Product
private:
const Product& _ref() const { return *this; }
- const Product& _constRef() const { return *this; }
int _rows() const { return m_lhs.rows(); }
int _cols() const { return m_rhs.cols(); }
@@ -115,7 +114,7 @@ template<typename OtherDerived>
Product<Derived, OtherDerived>
Object<Scalar, Derived>::lazyProduct(const Object<Scalar, OtherDerived> &other) const
{
- return Product<Derived, OtherDerived>(constRef(), other.constRef());
+ return Product<Derived, OtherDerived>(ref(), other.ref());
}
template<typename Scalar, typename Derived1, typename Derived2>