kokkos / mdspan

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

Implement operator== for mdarray #355

Open stefanbajakobsson opened 2 months ago

stefanbajakobsson commented 2 months ago

It would be convenient if the operator== would be implemented for the class mdarray.

mhoemmen commented 2 months ago

I wouldn't object to P1684 changing to include an operator==, as long as operator== is constrained on the element type being equality comparable.

operator<=> wouldn't make so much sense. std::vector::operator<=> is defined in terms of the order of elements. It iterates from .begin() to .end() and returns operator<=> evaluated on the first non-equivalent pair of elements. mdarray deliberately does not expose an iterator range or define a 1-D iteration order.

mhoemmen commented 2 months ago

@crtrott @dalg24 @nmm0

crtrott commented 2 months ago

Agreed.