further improve compilation error message for array+=matrix

This commit is contained in:
Gael Guennebaud
2010-08-16 11:13:02 +02:00
parent c625a6a85b
commit b37551f62a
3 changed files with 10 additions and 5 deletions

View File

@@ -429,9 +429,11 @@ template<typename Derived> class MatrixBase
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);
template<typename OtherDerived> Derived& operator+=(const ArrayBase<OtherDerived>& array)
{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 ArrayBase<OtherDerived>& array);
template<typename OtherDerived> Derived& operator-=(const ArrayBase<OtherDerived>& array)
{EIGEN_STATIC_ASSERT(sizeof(typename OtherDerived::Scalar)==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);}
};
#endif // EIGEN_MATRIXBASE_H