From 3669498f5a7cce29935386ab5380537b06a58edb Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Thu, 12 Nov 2020 15:59:29 -0800 Subject: Fix rule-of-3 for the Tensor module. Adds copy constructors to Tensor ops, inherits assignment operators from `TensorBase`. Addresses #1863 --- unsupported/Eigen/CXX11/src/Tensor/TensorMap.h | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMap.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h index 172a6bab8..6834c97e4 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h @@ -30,7 +30,7 @@ template class MakePoin { public: typedef TensorMap Self; - typedef typename PlainObjectType::Base Base; + typedef TensorBase > Base; #ifdef EIGEN_USE_SYCL typedef typename Eigen::internal::remove_reference::type>::type Nested; #else @@ -40,7 +40,7 @@ template class MakePoin typedef typename internal::traits::Index Index; typedef typename internal::traits::Scalar Scalar; typedef typename NumTraits::Real RealScalar; - typedef typename Base::CoeffReturnType CoeffReturnType; + typedef typename PlainObjectType::Base::CoeffReturnType CoeffReturnType; typedef typename MakePointer_::Type PointerType; typedef typename MakePointer_::ConstType PointerConstType; @@ -315,23 +315,7 @@ template class MakePoin } #endif - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Self& operator=(const Self& other) - { - typedef TensorAssignOp Assign; - Assign assign(*this, other); - internal::TensorExecutor::run(assign, DefaultDevice()); - return *this; - } - - template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - Self& operator=(const OtherDerived& other) - { - typedef TensorAssignOp Assign; - Assign assign(*this, other); - internal::TensorExecutor::run(assign, DefaultDevice()); - return *this; - } + EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorMap) private: StoragePointerType m_data; -- cgit v1.2.3