Revert "Make fixed-size Matrix and Array trivially copyable after C++20"

This reverts commit 47eac21072
This commit is contained in:
Antonio Sánchez
2022-02-05 04:40:29 +00:00
parent 979fdd58a4
commit 9441d94dcc
11 changed files with 2 additions and 127 deletions

View File

@@ -52,14 +52,6 @@ public:
Alignment = actual_alignment
};
};
template<typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
struct has_trivially_copyable_storage<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
{
// Must be identical to the type of PlainObjectBase::m_storage.
typedef DenseStorage<Scalar_, internal::size_at_compile_time<MaxRows_, MaxCols_>::ret, Rows_, Cols_, Options_> Storage;
static const bool value = std::is_trivially_copyable<Storage>::value;
};
}
/** \class Matrix
@@ -218,12 +210,6 @@ class Matrix
return Base::_set(other);
}
#if EIGEN_COMP_HAS_P0848R3
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix& operator=(
const Matrix& other) requires internal::has_trivially_copyable_storage<Matrix>::value = default;
#endif
/** \internal
* \brief Copies the value of the expression \a other into \c *this with automatic resizing.
*
@@ -293,13 +279,6 @@ class Matrix
return *this;
}
#if EIGEN_COMP_HAS_P0848R3
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(Matrix&& other) EIGEN_NOEXCEPT
requires internal::has_trivially_copyable_storage<Matrix>::value = default;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT
requires internal::has_trivially_copyable_storage<Matrix>::value = default;
#endif
/** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&... args)
*
* Example: \include Matrix_variadic_ctor_cxx11.cpp
@@ -425,12 +404,6 @@ class Matrix
EIGEN_STRONG_INLINE Matrix(const Matrix& other) : Base(other)
{ }
#if EIGEN_COMP_HAS_P0848R3
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix(const Matrix& other) requires internal::has_trivially_copyable_storage<Matrix>::value =
default;
#endif
/** \brief Copy constructor for generic expressions.
* \sa MatrixBase::operator=(const EigenBase<OtherDerived>&)
*/