From eb7863ebd04dbef9ec694eeb4c07645d8f870ff4 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 19 Jul 2016 17:21:49 +0200 Subject: [PATCH] Workaround MSVC 2013 compilation issue in Reverse (users are unlikely to be affected) --- Eigen/src/Core/Reverse.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/Reverse.h b/Eigen/src/Core/Reverse.h index e30ae3d28..041f8222a 100644 --- a/Eigen/src/Core/Reverse.h +++ b/Eigen/src/Core/Reverse.h @@ -76,9 +76,23 @@ template class Reverse EIGEN_DENSE_PUBLIC_INTERFACE(Reverse) using Base::IsRowMajor; - // next line is necessary because otherwise const version of operator() - // is hidden by non-const version defined in this file - using Base::operator(); + // The following two operators are provided to worarkound + // a MSVC 2013 issue. In theory, we could simply do: + // using Base::operator(); + // to make const version of operator() visible. + // Otheriwse, they would be hidden by the non-const versions defined in this file + + inline CoeffReturnType operator()(Index row, Index col) const + { + eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); + return coeff(row, col); + } + + inline CoeffReturnType operator()(Index index) const + { + eigen_assert(index >= 0 && index < m_matrix.size()); + return coeff(index); + } protected: enum {