Draft: make fixed-size objects trivially move assignable again

Reference issue

#1855

What does this implement/fix?

Follow up to !1727 (merged) which was reverted in !1730 (merged). Added additional operators to maintain current behavior that allows us to assign Derived to MatrixBase<Derived> while getting a little bit closer to is_trivially_copyable.

  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr MatrixBase& operator=(Derived&& other) {
    swap(derived(), other);
    return *this;
  }

  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr ArrayBase& operator=(Derived&& other) {
    swap(derived(), other);
    return *this;
  }

This arguably encourages questionable coding practices, but I see no harm if it is explicitly supported by Eigen.

Additional information

Edited by Charles Schlosser

Merge request reports

Loading