From 2d4c9b400cca33d2f5cf316efc7151236244edb1 Mon Sep 17 00:00:00 2001 From: Charles Schlosser Date: Tue, 17 Sep 2024 17:43:36 +0000 Subject: [PATCH] make fixed size matrices and arrays trivially_copy_constructible and trivially_move_constructible --- Eigen/src/Core/Array.h | 6 ++---- Eigen/src/Core/Matrix.h | 6 ++---- Eigen/src/Core/PlainObjectBase.h | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 29c968210..c808b63a1 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -126,9 +126,7 @@ class Array : public PlainObjectBase::value) - : Base(std::move(other)) { - } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Array(Array && other) = default; EIGEN_DEVICE_FUNC Array& operator=(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable::value) { Base::operator=(std::move(other)); return *this; @@ -232,7 +230,7 @@ class Array : public PlainObjectBase::value) - : Base(std::move(other)) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Matrix(Matrix && other) = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable::value) { Base::operator=(std::move(other)); @@ -379,7 +377,7 @@ class Matrix : public PlainObjectBase&) diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index 5f846a0f1..df90318bf 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -485,8 +485,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type } #endif - EIGEN_DEVICE_FUNC constexpr PlainObjectBase(PlainObjectBase&& other) EIGEN_NOEXCEPT - : m_storage(std::move(other.m_storage)) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase(PlainObjectBase&& other) = default; EIGEN_DEVICE_FUNC constexpr PlainObjectBase& operator=(PlainObjectBase&& other) EIGEN_NOEXCEPT { m_storage = std::move(other.m_storage); @@ -494,8 +493,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type } /** Copy constructor */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase(const PlainObjectBase& other) - : Base(), m_storage(other.m_storage) {} + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase(const PlainObjectBase& other) = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(Index size, Index rows, Index cols) : m_storage(size, rows, cols) { // EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED