|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4491" status="New"> |
| 5 | +<title>Rename `submdspan_extents` and `submdspan_canonicalize_slices`</title> |
| 6 | +<section><sref ref="[mdspan.sub]"/></section> |
| 7 | +<submitter>Tomasz Kamiński</submitter> |
| 8 | +<date>16 Dec 2025</date> |
| 9 | +<priority>99</priority> |
| 10 | + |
| 11 | +<discussion> |
| 12 | +<b>Addresses <a href="https://github.com/cplusplus/nbballot/issues/815">US 152-243</a> |
| 13 | +and <a href="https://github.com/cplusplus/nbballot/issues/817">PL-008</a>.</b> |
| 14 | + |
| 15 | +<p>Rename `submdspan_extents` to `subextents` and `submdspan_canonicalize_slices` to `canonical_slices`.</p> |
| 16 | +</discussion> |
| 17 | + |
| 18 | +<resolution> |
| 19 | +<p> |
| 20 | +This wording is relative to <paper num="N5032"/>. |
| 21 | +</p> |
| 22 | + |
| 23 | +<ol> |
| 24 | +<li><p>Modify <sref ref="[mdspan.syn]"/> as follows:</p> |
| 25 | + |
| 26 | +<blockquote> |
| 27 | +<pre> |
| 28 | +// <sref ref="[mdspan.sub]"/>, submdspan creation |
| 29 | +template<class OffsetType, class LengthType, class StrideType> |
| 30 | + struct strided_slice; |
| 31 | + |
| 32 | +template<class LayoutMapping> |
| 33 | + struct submdspan_mapping_result; |
| 34 | + |
| 35 | +struct full_extent_t { explicit full_extent_t() = default; }; |
| 36 | +inline constexpr full_extent_t full_extent{}; |
| 37 | + |
| 38 | +template<class IndexType, size_t... Extents, class... SliceSpecifiers> |
| 39 | + constexpr auto sub<del>mdspan_</del>extents(const extents<IndexType, Extents...>&, SliceSpecifiers...); |
| 40 | + |
| 41 | +// <sref ref="[mdspan.sub.canonical]"/>, submdspan slice canonicalization |
| 42 | +template<class IndexType, size_t... Extents, class... Slices> |
| 43 | + constexpr auto <del>submdspan_canonicalize</del><ins>canonical</ins>_slices(const extents<IndexType, Extents...>& src, |
| 44 | + Slices... slices); |
| 45 | +</pre> |
| 46 | +</blockquote> |
| 47 | +</li> |
| 48 | + |
| 49 | +<li><p>Modify <sref ref="[mdspan.sub.canonical]"/> as follows:</p> |
| 50 | + |
| 51 | +<blockquote> |
| 52 | +<h4>`submdspan` slice canonicalization</h4> |
| 53 | +<pre> |
| 54 | +template<class IndexType, size_t... Extents, class... Slices> |
| 55 | + constexpr auto <del>submdspan_canonicalize</del><ins>canonical</ins>_slices(const extents<IndexType, Extents...>& src, |
| 56 | + Slices... slices); |
| 57 | +</pre> |
| 58 | +</blockquote> |
| 59 | +</li> |
| 60 | + |
| 61 | +<li><p>Modify <sref ref="[mdspan.sub.extents]"/> as follows:</p> |
| 62 | + |
| 63 | +<blockquote> |
| 64 | +<h4><sref ref="[mdspan.sub.extents]"/> <tt>sub<del>mdspan_</del>extents</tt> function</h4> |
| 65 | + |
| 66 | +<pre> |
| 67 | +template<class IndexType, size_t... Extents, class... SliceSpecifiers> |
| 68 | + constexpr auto sub<del>mdspan_</del>extents(const extents<IndexType, Extents...>& src, |
| 69 | + SliceSpecifiers... raw_slices); |
| 70 | +</pre> |
| 71 | +<blockquote> |
| 72 | +<p>-1- Let `slices` be the pack introduced by the following declaration: |
| 73 | +<pre> |
| 74 | + auto [...slices] = <del>submdspan_canonicalize</del><ins>canonical</ins>_slices(src, raw_slices...) |
| 75 | +</pre></p> |
| 76 | +</blockquote> |
| 77 | +</blockquote> |
| 78 | +</li> |
| 79 | + |
| 80 | +<li><p>Modify <sref ref="[mdspan.sub.map.sliceable]"/> as follows:</p> |
| 81 | +<blockquote> |
| 82 | +<blockquote> |
| 83 | +<p>-5- <i>Returns</i>: An object `smr` of type `SMR` such that |
| 84 | +<ul> |
| 85 | +<li>-5.1- <tt>smr.mapping.extents() == sub<del>mdspan_</del>extents(m.extents(), valid_slices...)</tt> is `true`; and</li> |
| 86 | +<li>-5.2- […]</li> |
| 87 | +</ul></p> |
| 88 | +</blockquote> |
| 89 | +</blockquote> |
| 90 | +</li> |
| 91 | + |
| 92 | +<li><p>Modify <sref ref="[mdspan.sub.map.common]"/> as follows:</p> |
| 93 | +<blockquote> |
| 94 | +<blockquote> |
| 95 | +<p>-5- Let `sub_ext` be the result of <tt>sub<del>mdspan_</del>extents(extents(), slices...)</tt> |
| 96 | +and let `SubExtents` be `decltype(sub_ext)`.</p> |
| 97 | +</blockquote> |
| 98 | +</blockquote> |
| 99 | +</li> |
| 100 | + |
| 101 | +<li><p>Modify <sref ref="[mdspan.sub.sub]"/> as follows:</p> |
| 102 | +<blockquote> |
| 103 | +<blockquote> |
| 104 | +<p>-2- Let `slices` be the pack introduced by the following declaration: |
| 105 | +<pre> |
| 106 | + auto [...slices] = <del>submdspan_canonicalize</del><ins>canonical</ins>_slices(src, raw_slices...) |
| 107 | +</pre></p> |
| 108 | +</blockquote> |
| 109 | +</blockquote> |
| 110 | +</li> |
| 111 | + |
| 112 | +</ol> |
| 113 | + |
| 114 | +</resolution> |
| 115 | + |
| 116 | +</issue> |
0 commit comments