Title
Rename `submdspan_extents` and `submdspan_canonicalize_slices`
Status
new
Section
[mdspan.sub]
Submitter
Tomasz Kamiński

Created on 2025-12-16.00:00:00 last changed 1 week ago

Messages

Date: 2025-12-20.13:10:45

Proposed resolution:

This wording is relative to N5032.

  1. Modify [mdspan.syn] as follows:

    // [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 [mdspan.sub.extents] as follows:

    [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 [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 [mdspan.sub.sub] as follows:

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

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

Date: 2025-12-16.00:00:00
Addresses US 152-243 and PL-008.

Rename `submdspan_extents` to `subextents` and `submdspan_canonicalize_slices` to `canonical_slices`.

History
Date User Action Args
2025-12-20 13:10:45adminsetmessages: + msg15830
2025-12-16 00:00:00admincreate