aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-08-16 11:07:17 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-08-16 11:07:17 +0200
commitc625a6a85b8a6a805ee3e3dc5afe8555838415e4 (patch)
treed69a0a072003b77b2536eb2dff893c5118cb8660 /Eigen
parent453d54325e020746c00a141712e448dec42c0e2e (diff)
improve compilation error message for array+=matrix and the likes
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/ArrayBase.h5
-rw-r--r--Eigen/src/Core/MatrixBase.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/Eigen/src/Core/ArrayBase.h b/Eigen/src/Core/ArrayBase.h
index 941e39938..c53ea0a4f 100644
--- a/Eigen/src/Core/ArrayBase.h
+++ b/Eigen/src/Core/ArrayBase.h
@@ -167,6 +167,11 @@ template<typename Derived> class ArrayBase
explicit ArrayBase(Index);
ArrayBase(Index,Index);
template<typename OtherDerived> explicit ArrayBase(const ArrayBase<OtherDerived>&);
+ protected:
+ // mixing arrays and matrices is not legal
+ template<typename OtherDerived> Derived& operator+=(const MatrixBase<OtherDerived>& mat);
+ // mixing arrays and matrices is not legal
+ template<typename OtherDerived> Derived& operator-=(const MatrixBase<OtherDerived>& mat);
};
/** replaces \c *this by \c *this - \a other.
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 0c2bbf5bf..1b0784c2b 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -427,6 +427,11 @@ template<typename Derived> class MatrixBase
explicit MatrixBase(int);
MatrixBase(int,int);
template<typename OtherDerived> explicit MatrixBase(const MatrixBase<OtherDerived>&);
+ protected:
+ // mixing arrays and matrices is not legal
+ template<typename OtherDerived> Derived& operator+=(const ArrayBase<OtherDerived>& array);
+ // mixing arrays and matrices is not legal
+ template<typename OtherDerived> Derived& operator-=(const ArrayBase<OtherDerived>& array);
};
#endif // EIGEN_MATRIXBASE_H