Skip to content

Commit b525ffe

Browse files
author
github-actions
committed
Automatic update from GitHub Actions workflow
1 parent d31ecad commit b525ffe

23 files changed

+934
-42
lines changed

issue3876.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ <h3 id="3876"><a href="lwg-defects.html#3876">3876</a>. Default constructor of <
6767
<b>Submitter:</b> Christian Trott <b>Opened:</b> 2023-02-09 <b>Last modified:</b> 2023-11-22</p>
6868
<p><b>Priority: </b>Not Prioritized
6969
</p>
70+
<p><b>View all other</b> <a href="lwg-index.html#mdspan.layout">issues</a> in [mdspan.layout].</p>
7071
<p><b>View all issues with</b> <a href="lwg-status.html#C++23">C++23</a> status.</p>
7172
<p><b>Discussion:</b></p>
7273
<p>

issue4272.html

Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Issue 4272: For rank == 0, layout_stride is atypically convertible</title>
6+
<meta property="og:title" content="Issue 4272: For rank == 0, layout_stride is atypically convertible">
7+
<meta property="og:description" content="C++ library issue. Status: New">
8+
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue4272.html">
9+
<meta property="og:type" content="website">
10+
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
11+
<meta property="og:image:alt" content="C++ logo">
12+
<style>
13+
p {text-align:justify}
14+
li {text-align:justify}
15+
pre code.backtick::before { content: "`" }
16+
pre code.backtick::after { content: "`" }
17+
blockquote.note
18+
{
19+
background-color:#E0E0E0;
20+
padding-left: 15px;
21+
padding-right: 15px;
22+
padding-top: 1px;
23+
padding-bottom: 1px;
24+
}
25+
ins {background-color:#A0FFA0}
26+
del {background-color:#FFA0A0}
27+
table.issues-index { border: 1px solid; border-collapse: collapse; }
28+
table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
29+
table.issues-index td { padding: 4px; border: 1px solid; }
30+
table.issues-index td:nth-child(1) { text-align: right; }
31+
table.issues-index td:nth-child(2) { text-align: left; }
32+
table.issues-index td:nth-child(3) { text-align: left; }
33+
table.issues-index td:nth-child(4) { text-align: left; }
34+
table.issues-index td:nth-child(5) { text-align: center; }
35+
table.issues-index td:nth-child(6) { text-align: center; }
36+
table.issues-index td:nth-child(7) { text-align: left; }
37+
table.issues-index td:nth-child(5) span.no-pr { color: red; }
38+
@media (prefers-color-scheme: dark) {
39+
html {
40+
color: #ddd;
41+
background-color: black;
42+
}
43+
ins {
44+
background-color: #225522
45+
}
46+
del {
47+
background-color: #662222
48+
}
49+
a {
50+
color: #6af
51+
}
52+
a:visited {
53+
color: #6af
54+
}
55+
blockquote.note
56+
{
57+
background-color: rgba(255, 255, 255, .10)
58+
}
59+
}
60+
</style>
61+
</head>
62+
<body>
63+
<hr>
64+
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#New">New</a> status.</em></p>
65+
<h3 id="4272"><a href="lwg-active.html#4272">4272</a>. For <code class='backtick'>rank == 0</code>, <code class='backtick'>layout_stride</code> is atypically convertible</h3>
66+
<p><b>Section:</b> 23.7.3.4 <a href="https://wg21.link/mdspan.layout">[mdspan.layout]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
67+
<b>Submitter:</b> Luc Grosheintz <b>Opened:</b> 2025-06-02 <b>Last modified:</b> 2025-06-06</p>
68+
<p><b>Priority: </b>Not Prioritized
69+
</p>
70+
<p><b>View all other</b> <a href="lwg-index.html#mdspan.layout">issues</a> in [mdspan.layout].</p>
71+
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
72+
<p><b>Discussion:</b></p>
73+
<p>
74+
Commonly, two layouts are considered convertible, if the underlying
75+
<code class='backtick'>extent_types</code> are convertible.
76+
<p/>
77+
However, for the two ctors <code class='backtick'>layout_left(layout_stride)</code> and
78+
<code class='backtick'>layout_right(layout_stride)</code>, the condition is <code>rank &gt; 0</code>. Therefore,
79+
</p>
80+
<blockquote><pre>
81+
using E1 = std::extents&lt;int&gt;;
82+
using E2 = std::extents&lt;unsigned int&gt;;
83+
84+
static_assert(std::is_convertible_v&lt;
85+
std::layout_stride::mapping&lt;E2&gt;,
86+
std::layout_right::mapping&lt;E1&gt;
87+
&gt;);
88+
</pre></blockquote>
89+
<p>
90+
even though:
91+
</p>
92+
<blockquote><pre>
93+
static_assert(!std::is_convertible_v&lt;E2, E1&gt;);
94+
</pre></blockquote>
95+
<p>
96+
Moreover, for rank 0 <code class='backtick'>layout_stride</code> can be converted to any
97+
specialization of <code class='backtick'>layout_left</code> or <code class='backtick'>layout_right</code>; but not to every
98+
specialization of <code class='backtick'>layout_stride</code>.
99+
</p>
100+
101+
102+
<p id="res-4272"><b>Proposed resolution:</b></p>
103+
<p>
104+
This wording is relative to <a href="https://wg21.link/N5008">N5008</a>.
105+
</p>
106+
107+
<blockquote class="note">
108+
<p>
109+
[<i>Drafting note</i>: As drive-by fixes the edits for <code>layout_left_padded&lt;&gt;::mapping</code> and
110+
<code>layout_right_padded&lt;&gt;::mapping</code> also correct an editorial asymmetry between class
111+
header synopsis declaration form and prototype specification form of the corresponding
112+
constructors and adjust to the correct spelling of the exposition-only data member <code><i>rank_</i></code>.]
113+
</p>
114+
</blockquote>
115+
116+
<ol>
117+
<li><p>Modify 23.7.3.4.5.1 <a href="https://wg21.link/mdspan.layout.left.overview">[mdspan.layout.left.overview]</a> as indicated:</p>
118+
119+
<blockquote>
120+
<pre>
121+
namespace std {
122+
template&lt;class Extents&gt;
123+
class layout_left::mapping {
124+
[&hellip;]
125+
<i>// 23.7.3.4.5.2 <a href="https://wg21.link/mdspan.layout.left.cons">[mdspan.layout.left.cons]</a>, constructors</i>
126+
[&hellip;]
127+
template&lt;class OtherExtents&gt;
128+
constexpr explicit(<del>extents_type::rank() &gt; 0</del><ins><i>see below</i></ins>)
129+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp;);
130+
131+
constexpr mapping&amp; operator=(const mapping&amp;) noexcept = default;
132+
[&hellip;]
133+
};
134+
}
135+
</pre>
136+
</blockquote>
137+
</li>
138+
139+
<li><p>Modify 23.7.3.4.5.2 <a href="https://wg21.link/mdspan.layout.left.cons">[mdspan.layout.left.cons]</a> as indicated:</p>
140+
141+
<blockquote>
142+
<pre>
143+
template&lt;class OtherExtents&gt;
144+
constexpr explicit(<del>extents_type::rank() &gt; 0</del><ins><i>see below</i></ins>)
145+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp; other);
146+
</pre>
147+
<blockquote>
148+
<p>
149+
-13- <i>Constraints</i>: [&hellip;]
150+
<p/>
151+
-14- <i>Preconditions</i>: [&hellip;]
152+
<p/>
153+
-15- <i>Effects</i>: [&hellip;]
154+
<p/>
155+
<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins>
156+
</p>
157+
<blockquote><pre>
158+
<ins>!(extents_type::rank() == 0 &amp;&amp; is_convertible_v&lt;OtherExtents, extents_type&gt;)</ins>
159+
</pre></blockquote>
160+
</blockquote>
161+
</blockquote>
162+
</li>
163+
164+
<li><p>Modify 23.7.3.4.6.1 <a href="https://wg21.link/mdspan.layout.right.overview">[mdspan.layout.right.overview]</a> as indicated:</p>
165+
166+
<blockquote>
167+
<pre>
168+
namespace std {
169+
template&lt;class Extents&gt;
170+
class layout_right::mapping {
171+
[&hellip;]
172+
<i>// 23.7.3.4.6.2 <a href="https://wg21.link/mdspan.layout.right.cons">[mdspan.layout.right.cons]</a>, constructors</i>
173+
[&hellip;]
174+
template&lt;class OtherExtents&gt;
175+
constexpr explicit(<del>extents_type::rank() &gt; 0</del><ins><i>see below</i></ins>)
176+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp;);
177+
178+
constexpr mapping&amp; operator=(const mapping&amp;) noexcept = default;
179+
[&hellip;]
180+
};
181+
}
182+
</pre>
183+
</blockquote>
184+
</li>
185+
186+
<li><p>Modify 23.7.3.4.6.2 <a href="https://wg21.link/mdspan.layout.right.cons">[mdspan.layout.right.cons]</a> as indicated:</p>
187+
188+
<blockquote>
189+
<pre>
190+
template&lt;class OtherExtents&gt;
191+
constexpr explicit(<del>extents_type::rank() &gt; 0</del><ins><i>see below</i></ins>)
192+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp; other);
193+
</pre>
194+
<blockquote>
195+
<p>
196+
-13- <i>Constraints</i>: [&hellip;]
197+
<p/>
198+
-14- <i>Preconditions</i>: [&hellip;]
199+
<p/>
200+
-15- <i>Effects</i>: [&hellip;]
201+
<p/>
202+
<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins>
203+
</p>
204+
<blockquote><pre>
205+
<ins>!(extents_type::rank() == 0 &amp;&amp; is_convertible_v&lt;OtherExtents, extents_type&gt;)</ins>
206+
</pre></blockquote>
207+
</blockquote>
208+
</blockquote>
209+
</li>
210+
211+
<li><p>Modify 23.7.3.4.8.1 <a href="https://wg21.link/mdspan.layout.leftpad.overview">[mdspan.layout.leftpad.overview]</a> as indicated:</p>
212+
213+
<blockquote>
214+
<pre>
215+
namespace std {
216+
template&lt;size_t PaddingValue&gt;
217+
template&lt;class Extents&gt;
218+
class layout_left_padded&lt;PaddingValue&gt;::mapping {
219+
[&hellip;]
220+
<i>// 23.7.3.4.8.3 <a href="https://wg21.link/mdspan.layout.leftpad.cons">[mdspan.layout.leftpad.cons]</a>, constructors</i>
221+
[&hellip;]
222+
template&lt;class OtherExtents&gt;
223+
constexpr explicit(<del>extents_type::rank() &gt; 0</del><ins><i>see below</i></ins>)
224+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp;);
225+
[&hellip;]
226+
};
227+
}
228+
</pre>
229+
</blockquote>
230+
</li>
231+
232+
<li><p>Modify 23.7.3.4.8.3 <a href="https://wg21.link/mdspan.layout.leftpad.cons">[mdspan.layout.leftpad.cons]</a> as indicated:</p>
233+
234+
<blockquote>
235+
<pre>
236+
template&lt;class OtherExtents&gt;
237+
constexpr explicit(<del>rank_ &gt; 0</del><ins><i>see below</i></ins>)
238+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp; other);
239+
</pre>
240+
<blockquote>
241+
<p>
242+
-10- <i>Constraints</i>: [&hellip;]
243+
<p/>
244+
-11- <i>Preconditions</i>: [&hellip;]
245+
<p/>
246+
-12- <i>Effects</i>: [&hellip;]
247+
<p/>
248+
<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins>
249+
</p>
250+
<blockquote><pre>
251+
<ins>!(<i>rank_</i> == 0 &amp;&amp; is_convertible_v&lt;OtherExtents, extents_type&gt;)</ins>
252+
</pre></blockquote>
253+
</blockquote>
254+
</blockquote>
255+
</li>
256+
257+
<li><p>Modify 23.7.3.4.9.1 <a href="https://wg21.link/mdspan.layout.rightpad.overview">[mdspan.layout.rightpad.overview]</a> as indicated:</p>
258+
259+
<blockquote>
260+
<pre>
261+
namespace std {
262+
template&lt;size_t PaddingValue&gt;
263+
template&lt;class Extents&gt;
264+
class layout_right_padded&lt;PaddingValue&gt;::mapping {
265+
[&hellip;]
266+
<i>// 23.7.3.4.9.3 <a href="https://wg21.link/mdspan.layout.rightpad.cons">[mdspan.layout.rightpad.cons]</a>, constructors</i>
267+
[&hellip;]
268+
template&lt;class OtherExtents&gt;
269+
constexpr explicit(<del>rank_ &gt; 0</del><ins><i>see below</i></ins>)
270+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp;);
271+
[&hellip;]
272+
};
273+
}
274+
</pre>
275+
</blockquote>
276+
</li>
277+
278+
<li><p>Modify 23.7.3.4.9.3 <a href="https://wg21.link/mdspan.layout.rightpad.cons">[mdspan.layout.rightpad.cons]</a> as indicated:</p>
279+
280+
<blockquote>
281+
<pre>
282+
template&lt;class OtherExtents&gt;
283+
constexpr explicit(<del>rank_ &gt; 0</del><ins><i>see below</i></ins>)
284+
mapping(const layout_stride::mapping&lt;OtherExtents&gt;&amp; other);
285+
</pre>
286+
<blockquote>
287+
<p>
288+
-10- <i>Constraints</i>: [&hellip;]
289+
<p/>
290+
-11- <i>Preconditions</i>: [&hellip;]
291+
<p/>
292+
-12- <i>Effects</i>: [&hellip;]
293+
<p/>
294+
<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins>
295+
</p>
296+
<blockquote><pre>
297+
<ins>!(<i>rank_</i> == 0 &amp;&amp; is_convertible_v&lt;OtherExtents, extents_type&gt;)</ins>
298+
</pre></blockquote>
299+
</blockquote>
300+
</blockquote>
301+
</li>
302+
303+
</ol>
304+
305+
306+
307+
308+
309+
</body>
310+
</html>

0 commit comments

Comments
 (0)