This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4491. Rename submdspan_extents and submdspan_canonicalize_slices

Section: 23.7.3.7 [mdspan.sub] Status: New Submitter: Tomasz KamiƄski Opened: 2025-12-16 Last modified: 2025-12-20

Priority: Not Prioritized

View all issues with New status.

Discussion:

Addresses US 152-243 and PL-008.

Rename submdspan_extents to subextents and submdspan_canonicalize_slices to canonical_slices.

Proposed resolution:

This wording is relative to N5032.

  1. Modify 23.7.3.2 [mdspan.syn] as follows:

    // 23.7.3.7 [mdspan.sub], submdspan creation
    template<class OffsetType, class LengthType, class StrideType>
      struct strided_slice;
    
    template<class LayoutMapping>
      struct submdspan_mapping_result;
    
    struct full_extent_t { explicit full_extent_t() = default; };
    inline constexpr full_extent_t full_extent{};
    
    template<class IndexType, size_t... Extents, class... SliceSpecifiers>
      constexpr auto submdspan_extents(const extents<IndexType, Extents...>&, SliceSpecifiers...);
    
    //  [mdspan.sub.canonical], submdspan slice canonicalization
    template<class IndexType, size_t... Extents, class... Slices>
      constexpr auto submdspan_canonicalizecanonical_slices(const extents<IndexType, Extents...>& src,
                                                   Slices... slices);
    
  2. Modify [mdspan.sub.canonical] as follows:

    submdspan slice canonicalization

    template<class IndexType, size_t... Extents, class... Slices>
      constexpr auto submdspan_canonicalizecanonical_slices(const extents<IndexType, Extents...>& src,
                                                   Slices... slices);
    
  3. Modify 23.7.3.7.5 [mdspan.sub.extents] as follows:

    23.7.3.7.5 [mdspan.sub.extents] submdspan_extents function

    template<class IndexType, size_t... Extents, class... SliceSpecifiers>
      constexpr auto submdspan_extents(const extents<IndexType, Extents...>& src,
                                       SliceSpecifiers... raw_slices);
    

    -1- Let slices be the pack introduced by the following declaration:

      auto [...slices] = submdspan_canonicalizecanonical_slices(src, raw_slices...)
    

  4. Modify [mdspan.sub.map.sliceable] as follows:

    -5- Returns: An object smr of type SMR such that

    • -5.1- smr.mapping.extents() == submdspan_extents(m.extents(), valid_slices...) is true; and
    • -5.2- […]

  5. Modify 23.7.3.7.6.1 [mdspan.sub.map.common] as follows:

    -5- Let sub_ext be the result of submdspan_extents(extents(), slices...) and let SubExtents be decltype(sub_ext).

  6. Modify 23.7.3.7.7 [mdspan.sub.sub] as follows:

    -2- Let slices be the pack introduced by the following declaration:

      auto [...slices] = submdspan_canonicalizecanonical_slices(src, raw_slices...)