aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/ArrayBase.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-08-16 11:13:02 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-08-16 11:13:02 +0200
commitb37551f62aa89d93bab82d171c1caeb7baf54885 (patch)
tree35623e39686d016d0bd9cc32ae7e3ac89ef346ea /Eigen/src/Core/ArrayBase.h
parentc625a6a85b8a6a805ee3e3dc5afe8555838415e4 (diff)
further improve compilation error message for array+=matrix
Diffstat (limited to 'Eigen/src/Core/ArrayBase.h')
-rw-r--r--Eigen/src/Core/ArrayBase.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/Core/ArrayBase.h b/Eigen/src/Core/ArrayBase.h
index c53ea0a4f..36bf71dde 100644
--- a/Eigen/src/Core/ArrayBase.h
+++ b/Eigen/src/Core/ArrayBase.h
@@ -169,9 +169,11 @@ template<typename Derived> class ArrayBase
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);
+ template<typename OtherDerived> Derived& operator+=(const MatrixBase<OtherDerived>& mat)
+ {EIGEN_STATIC_ASSERT(sizeof(typename OtherDerived::Scalar)==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);}
// mixing arrays and matrices is not legal
- template<typename OtherDerived> Derived& operator-=(const MatrixBase<OtherDerived>& mat);
+ template<typename OtherDerived> Derived& operator-=(const MatrixBase<OtherDerived>& mat)
+ {EIGEN_STATIC_ASSERT(sizeof(typename OtherDerived::Scalar)==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);}
};
/** replaces \c *this by \c *this - \a other.