ORNL / cpp-proposals-pub

Collaborating on papers for the ISO C++ committee - public repo
26 stars 26 forks source link

P3355R0: Add "Fix submdspan for C++26" proposal #462

Open mhoemmen opened 1 month ago

mhoemmen commented 1 month ago

Add P3355R0, "Fix submdspan for C++26."

We propose the following fixes to submdspan for C++26.

  1. Permit user-defined pair types to be used as slices, rather than restricting the list to the opt-in set of types in [tuple.like].

  2. Change layout_left, layout_right, layout_left_padded, and layout_right_padded so that if a slice is strided_slice where stride_type models integral-constant-like and stride_type::value equals 1, then the same layout mapping type results as if the slice models index-pair-like<index_type>. This lets users express a slice with compile-time extent that does not cause common layouts to devolve into layout_stride.