From bdcc0bc1570541c4516b83f1710586e214f6499f Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 7 Sep 2009 11:37:41 +0200 Subject: fix compilation of swap for ICC --- Eigen/src/Core/Matrix.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Eigen/src') diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 0975b3b77..2774e0d78 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -713,13 +713,11 @@ class Matrix m_storage.data()[1] = y; } - template + template friend struct ei_matrix_swap_impl; }; -template::ret, - bool IsDynamicSize = MatrixType::SizeAtCompileTime==Dynamic> +template struct ei_matrix_swap_impl { static inline void run(MatrixType& matrix, MatrixBase& other) @@ -729,7 +727,7 @@ struct ei_matrix_swap_impl }; template -struct ei_matrix_swap_impl +struct ei_matrix_swap_impl { static inline void run(MatrixType& matrix, MatrixBase& other) { @@ -741,7 +739,8 @@ template inline void Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::swap(const MatrixBase& other) { - ei_matrix_swap_impl::run(*this, *const_cast*>(&other)); + enum { SwapPointers = ei_is_same_type::ret && Base::SizeAtCompileTime==Dynamic }; + ei_matrix_swap_impl::run(*this, *const_cast*>(&other)); } /** \defgroup matrixtypedefs Global matrix typedefs -- cgit v1.2.3