diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 32b526ef3..f41c9e042 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -536,9 +536,6 @@ class Matrix resizeLike(other); } - template - struct ei_matrix_set_selector; - /** \internal Copies the value of the expression \a other into \c *this with automatic resizing. * * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), @@ -553,10 +550,16 @@ class Matrix template EIGEN_STRONG_INLINE Matrix& _set(const MatrixBase& other) { - ei_matrix_set_selector::run(*this,other.derived()); + _set_selector(other.derived(), typename ei_meta_if<(int(OtherDerived::Flags) & EvalBeforeAssigningBit), ei_meta_true, ei_meta_false>::ret()); return *this; } + template + EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const ei_meta_true&) { _set_noalias(other.eval()); } + + template + EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const ei_meta_false&) { _set_noalias(other); } + /** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which * is the case when creating a new matrix) so one can enforce lazy evaluation. * @@ -603,20 +606,6 @@ class Matrix } }; -template -template -struct Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ei_matrix_set_selector -{ - static void run(MatrixType& dst, const OtherDerived& src) { dst._set_noalias(src.eval()); } -}; - -template -template -struct Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ei_matrix_set_selector -{ - static void run(MatrixType& dst, const OtherDerived& src) { dst._set_noalias(src); } -}; - /** \defgroup matrixtypedefs Global matrix typedefs * * \ingroup Core_Module