kokkos / mdspan

Reference implementation of mdspan targeting C++23
Other
405 stars 69 forks source link

Mapping comparison operators are not constrained properly #268

Open dalg24 opened 1 year ago

dalg24 commented 1 year ago

For instance with layout_right, the standard says

template<class OtherExtents>
  friend constexpr bool operator==(const mapping& x, const mapping<OtherExtents>& y) noexcept;

Constraints: extents_type​::​rank() == OtherExtents​::​rank() is true. Effects: Equivalent to: return x.extents() == y.extents();

and our implementation does https://github.com/kokkos/mdspan/blob/26f4d3aaeead1e2ac2d892737c5b488136653620/include/experimental/__p0009_bits/layout_left.hpp#L190-L194

I realized that as I was reviewing Chrisitan's tests for libcxx