diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h b/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h index e12923da0..98223fe79 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h @@ -247,6 +247,8 @@ class TensorRef : public internal::TensorRefBase> { EIGEN_STRONG_INLINE TensorRef() : Base() {} + EIGEN_STRONG_INLINE TensorRef(const TensorRef& other) : Base(other) {} + template EIGEN_STRONG_INLINE TensorRef(const Expression& expr) : Base(expr) { EIGEN_STATIC_ASSERT(internal::is_lvalue::value, @@ -254,6 +256,8 @@ class TensorRef : public internal::TensorRefBase> { "TensorRef?)"); } + TensorRef& operator=(const TensorRef& other) { return Base::operator=(other).derived(); } + template EIGEN_STRONG_INLINE TensorRef& operator=(const Expression& expr) { EIGEN_STATIC_ASSERT(internal::is_lvalue::value, @@ -262,8 +266,6 @@ class TensorRef : public internal::TensorRefBase> { return Base::operator=(expr).derived(); } - TensorRef& operator=(const TensorRef& other) { return Base::operator=(other).derived(); } - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index firstIndex, IndexTypes... otherIndices) { const std::size_t num_indices = (sizeof...(otherIndices) + 1); @@ -306,17 +308,17 @@ class TensorRef : public internal::TensorRefBase EIGEN_STRONG_INLINE TensorRef(const Expression& expr) : Base(expr) {} + TensorRef& operator=(const TensorRef& other) { return Base::operator=(other).derived(); } + template EIGEN_STRONG_INLINE TensorRef& operator=(const Expression& expr) { return Base::operator=(expr).derived(); } - - TensorRef(const TensorRef& other) : Base(other) {} - - TensorRef& operator=(const TensorRef& other) { return Base::operator=(other).derived(); } }; // evaluator for rvalues