diff options
author | Alexander Karatarakis <alex@karatarakis.com> | 2021-06-30 04:27:51 +0000 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2021-06-30 04:27:51 +0000 |
commit | 60400334a92268272c6bf525da89eec5e99c3e5a (patch) | |
tree | fa3b80e40be0cef16a804e57e190b61436be8580 /Eigen/src | |
parent | c81da59a252b3479753b2eada26ee0cf46280bd0 (diff) |
Make DenseStorage<> trivially_copyable
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/DenseStorage.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 9acca6c90..8a4cbd4be 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -214,17 +214,26 @@ template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseSt EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(internal::constructor_without_unaligned_array_assert()) {} +#if !EIGEN_HAS_CXX11 || defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN) EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_data(other.m_data) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size) } +#else + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) = default; +#endif +#if !EIGEN_HAS_CXX11 EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) { if (this != &other) m_data = other.m_data; return *this; } +#else + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) = default; +#endif #if EIGEN_HAS_RVALUE_REFERENCES +#if !EIGEN_HAS_CXX11 EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT : m_data(std::move(other.m_data)) { @@ -235,6 +244,10 @@ template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseSt m_data = std::move(other.m_data); return *this; } +#else + EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT = default; + EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT = default; +#endif #endif EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) |