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.
submdspan_extents and submdspan_canonicalize_slicesSection: 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.
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 autosubmdspan_canonicalizecanonical_slices(const extents<IndexType, Extents...>& src, Slices... slices);
Modify [mdspan.sub.canonical] as follows:
submdspanslice canonicalizationtemplate<class IndexType, size_t... Extents, class... Slices> constexpr autosubmdspan_canonicalizecanonical_slices(const extents<IndexType, Extents...>& src, Slices... slices);
Modify 23.7.3.7.5 [mdspan.sub.extents] as follows:
23.7.3.7.5 [mdspan.sub.extents]
subfunctionmdspan_extentstemplate<class IndexType, size_t... Extents, class... SliceSpecifiers> constexpr auto submdspan_extents(const extents<IndexType, Extents...>& src, SliceSpecifiers... raw_slices);-1- Let
slicesbe the pack introduced by the following declaration:auto [...slices] =submdspan_canonicalizecanonical_slices(src, raw_slices...)
Modify [mdspan.sub.map.sliceable] as follows:
-5- Returns: An object
smrof typeSMRsuch that
- -5.1-
smr.mapping.extents() == subismdspan_extents(m.extents(), valid_slices...)true; and- -5.2- […]
Modify 23.7.3.7.6.1 [mdspan.sub.map.common] as follows:
-5- Let
sub_extbe the result ofsuband letmdspan_extents(extents(), slices...)SubExtentsbedecltype(sub_ext).
Modify 23.7.3.7.7 [mdspan.sub.sub] as follows:
-2- Let
slicesbe the pack introduced by the following declaration:auto [...slices] =submdspan_canonicalizecanonical_slices(src, raw_slices...)