From c625a6a85b8a6a805ee3e3dc5afe8555838415e4 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 16 Aug 2010 11:07:17 +0200 Subject: [PATCH] improve compilation error message for array+=matrix and the likes --- Eigen/src/Core/ArrayBase.h | 5 +++++ Eigen/src/Core/MatrixBase.h | 5 +++++ 2 files changed, 10 insertions(+) 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 class ArrayBase explicit ArrayBase(Index); ArrayBase(Index,Index); template explicit ArrayBase(const ArrayBase&); + protected: + // mixing arrays and matrices is not legal + template Derived& operator+=(const MatrixBase& mat); + // mixing arrays and matrices is not legal + template Derived& operator-=(const MatrixBase& 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 class MatrixBase explicit MatrixBase(int); MatrixBase(int,int); template explicit MatrixBase(const MatrixBase&); + protected: + // mixing arrays and matrices is not legal + template Derived& operator+=(const ArrayBase& array); + // mixing arrays and matrices is not legal + template Derived& operator-=(const ArrayBase& array); }; #endif // EIGEN_MATRIXBASE_H