|
64 | 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 | 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 | 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-14</p> |
| 67 | + <b>Submitter:</b> Luc Grosheintz <b>Opened:</b> 2025-06-02 <b>Last modified:</b> 2025-06-28</p> |
68 | 68 | <p><b>Priority: </b>2 |
69 | 69 | </p> |
70 | 70 | <p><b>View all other</b> <a href="lwg-index.html#mdspan.layout">issues</a> in [mdspan.layout].</p> |
@@ -105,6 +105,214 @@ <h3 id="4272"><a href="lwg-active.html#4272">4272</a>. For <code class='backtick |
105 | 105 | Set priority to 2 after reflector poll. |
106 | 106 | </p> |
107 | 107 |
|
| 108 | +<p><strong>Previous resolution [SUPERSEDED]:</strong></p> |
| 109 | +<blockquote class="note"> |
| 110 | + |
| 111 | +<p> |
| 112 | +This wording is relative to <a href="https://wg21.link/N5008">N5008</a>. |
| 113 | +</p> |
| 114 | + |
| 115 | +<blockquote class="note"> |
| 116 | +<p> |
| 117 | +[<i>Drafting note</i>: As drive-by fixes the edits for <code>layout_left_padded<>::mapping</code> and |
| 118 | +<code>layout_right_padded<>::mapping</code> also correct an editorial asymmetry between class |
| 119 | +header synopsis declaration form and prototype specification form of the corresponding |
| 120 | +constructors and adjust to the correct formatting of the exposition-only data member <code><i>rank_</i></code>.] |
| 121 | +</p> |
| 122 | +</blockquote> |
| 123 | + |
| 124 | +<ol> |
| 125 | +<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> |
| 126 | + |
| 127 | +<blockquote> |
| 128 | +<pre> |
| 129 | +namespace std { |
| 130 | + template<class Extents> |
| 131 | + class layout_left::mapping { |
| 132 | + […] |
| 133 | + <i>// 23.7.3.4.5.2 <a href="https://wg21.link/mdspan.layout.left.cons">[mdspan.layout.left.cons]</a>, constructors</i> |
| 134 | + […] |
| 135 | + template<class OtherExtents> |
| 136 | + constexpr explicit(<del>extents_type::rank() > 0</del><ins><i>see below</i></ins>) |
| 137 | + mapping(const layout_stride::mapping<OtherExtents>&); |
| 138 | + |
| 139 | + constexpr mapping& operator=(const mapping&) noexcept = default; |
| 140 | + […] |
| 141 | + }; |
| 142 | +} |
| 143 | +</pre> |
| 144 | +</blockquote> |
| 145 | +</li> |
| 146 | + |
| 147 | +<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> |
| 148 | + |
| 149 | +<blockquote> |
| 150 | +<pre> |
| 151 | +template<class OtherExtents> |
| 152 | + constexpr explicit(<del>extents_type::rank() > 0</del><ins><i>see below</i></ins>) |
| 153 | + mapping(const layout_stride::mapping<OtherExtents>& other); |
| 154 | +</pre> |
| 155 | +<blockquote> |
| 156 | +<p> |
| 157 | +-13- <i>Constraints</i>: […] |
| 158 | +<p/> |
| 159 | +-14- <i>Preconditions</i>: […] |
| 160 | +<p/> |
| 161 | +-15- <i>Effects</i>: […] |
| 162 | +<p/> |
| 163 | +<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins> |
| 164 | +</p> |
| 165 | +<blockquote><pre> |
| 166 | +<ins>!(extents_type::rank() == 0 && is_convertible_v<OtherExtents, extents_type>)</ins> |
| 167 | +</pre></blockquote> |
| 168 | +</blockquote> |
| 169 | +</blockquote> |
| 170 | +</li> |
| 171 | + |
| 172 | +<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> |
| 173 | + |
| 174 | +<blockquote> |
| 175 | +<pre> |
| 176 | +namespace std { |
| 177 | + template<class Extents> |
| 178 | + class layout_right::mapping { |
| 179 | + […] |
| 180 | + <i>// 23.7.3.4.6.2 <a href="https://wg21.link/mdspan.layout.right.cons">[mdspan.layout.right.cons]</a>, constructors</i> |
| 181 | + […] |
| 182 | + template<class OtherExtents> |
| 183 | + constexpr explicit(<del>extents_type::rank() > 0</del><ins><i>see below</i></ins>) |
| 184 | + mapping(const layout_stride::mapping<OtherExtents>&); |
| 185 | + |
| 186 | + constexpr mapping& operator=(const mapping&) noexcept = default; |
| 187 | + […] |
| 188 | + }; |
| 189 | +} |
| 190 | +</pre> |
| 191 | +</blockquote> |
| 192 | +</li> |
| 193 | + |
| 194 | +<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> |
| 195 | + |
| 196 | +<blockquote> |
| 197 | +<pre> |
| 198 | +template<class OtherExtents> |
| 199 | + constexpr explicit(<del>extents_type::rank() > 0</del><ins><i>see below</i></ins>) |
| 200 | + mapping(const layout_stride::mapping<OtherExtents>& other); |
| 201 | +</pre> |
| 202 | +<blockquote> |
| 203 | +<p> |
| 204 | +-13- <i>Constraints</i>: […] |
| 205 | +<p/> |
| 206 | +-14- <i>Preconditions</i>: […] |
| 207 | +<p/> |
| 208 | +-15- <i>Effects</i>: […] |
| 209 | +<p/> |
| 210 | +<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins> |
| 211 | +</p> |
| 212 | +<blockquote><pre> |
| 213 | +<ins>!(extents_type::rank() == 0 && is_convertible_v<OtherExtents, extents_type>)</ins> |
| 214 | +</pre></blockquote> |
| 215 | +</blockquote> |
| 216 | +</blockquote> |
| 217 | +</li> |
| 218 | + |
| 219 | +<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> |
| 220 | + |
| 221 | +<blockquote> |
| 222 | +<pre> |
| 223 | +namespace std { |
| 224 | + template<size_t PaddingValue> |
| 225 | + template<class Extents> |
| 226 | + class layout_left_padded<PaddingValue>::mapping { |
| 227 | + […] |
| 228 | + <i>// 23.7.3.4.8.3 <a href="https://wg21.link/mdspan.layout.leftpad.cons">[mdspan.layout.leftpad.cons]</a>, constructors</i> |
| 229 | + […] |
| 230 | + template<class OtherExtents> |
| 231 | + constexpr explicit(<del>extents_type::rank() > 0</del><ins><i>see below</i></ins>) |
| 232 | + mapping(const layout_stride::mapping<OtherExtents>&); |
| 233 | + […] |
| 234 | + }; |
| 235 | +} |
| 236 | +</pre> |
| 237 | +</blockquote> |
| 238 | +</li> |
| 239 | + |
| 240 | +<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> |
| 241 | + |
| 242 | +<blockquote> |
| 243 | +<pre> |
| 244 | +template<class OtherExtents> |
| 245 | + constexpr explicit(<del>rank_ > 0</del><ins><i>see below</i></ins>) |
| 246 | + mapping(const layout_stride::mapping<OtherExtents>& other); |
| 247 | +</pre> |
| 248 | +<blockquote> |
| 249 | +<p> |
| 250 | +-10- <i>Constraints</i>: […] |
| 251 | +<p/> |
| 252 | +-11- <i>Preconditions</i>: […] |
| 253 | +<p/> |
| 254 | +-12- <i>Effects</i>: […] |
| 255 | +<p/> |
| 256 | +<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins> |
| 257 | +</p> |
| 258 | +<blockquote><pre> |
| 259 | +<ins>!(<i>rank_</i> == 0 && is_convertible_v<OtherExtents, extents_type>)</ins> |
| 260 | +</pre></blockquote> |
| 261 | +</blockquote> |
| 262 | +</blockquote> |
| 263 | +</li> |
| 264 | + |
| 265 | +<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> |
| 266 | + |
| 267 | +<blockquote> |
| 268 | +<pre> |
| 269 | +namespace std { |
| 270 | + template<size_t PaddingValue> |
| 271 | + template<class Extents> |
| 272 | + class layout_right_padded<PaddingValue>::mapping { |
| 273 | + […] |
| 274 | + <i>// 23.7.3.4.9.3 <a href="https://wg21.link/mdspan.layout.rightpad.cons">[mdspan.layout.rightpad.cons]</a>, constructors</i> |
| 275 | + […] |
| 276 | + template<class OtherExtents> |
| 277 | + constexpr explicit(<del>rank_ > 0</del><ins><i>see below</i></ins>) |
| 278 | + mapping(const layout_stride::mapping<OtherExtents>&); |
| 279 | + […] |
| 280 | + }; |
| 281 | +} |
| 282 | +</pre> |
| 283 | +</blockquote> |
| 284 | +</li> |
| 285 | + |
| 286 | +<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> |
| 287 | + |
| 288 | +<blockquote> |
| 289 | +<pre> |
| 290 | +template<class OtherExtents> |
| 291 | + constexpr explicit(<del>rank_ > 0</del><ins><i>see below</i></ins>) |
| 292 | + mapping(const layout_stride::mapping<OtherExtents>& other); |
| 293 | +</pre> |
| 294 | +<blockquote> |
| 295 | +<p> |
| 296 | +-10- <i>Constraints</i>: […] |
| 297 | +<p/> |
| 298 | +-11- <i>Preconditions</i>: […] |
| 299 | +<p/> |
| 300 | +-12- <i>Effects</i>: […] |
| 301 | +<p/> |
| 302 | +<ins>-?- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to:</ins> |
| 303 | +</p> |
| 304 | +<blockquote><pre> |
| 305 | +<ins>!(<i>rank_</i> == 0 && is_convertible_v<OtherExtents, extents_type>)</ins> |
| 306 | +</pre></blockquote> |
| 307 | +</blockquote> |
| 308 | +</blockquote> |
| 309 | +</li> |
| 310 | + |
| 311 | +</ol> |
| 312 | +</blockquote> |
| 313 | + |
| 314 | +<p><i>[2025-06-20, Luc Grosheintz provides further wording improvements]</i></p> |
| 315 | + |
108 | 316 |
|
109 | 317 |
|
110 | 318 | <p id="res-4272"><b>Proposed resolution:</b></p> |
@@ -259,6 +467,26 @@ <h3 id="4272"><a href="lwg-active.html#4272">4272</a>. For <code class='backtick |
259 | 467 | <ins>!(<i>rank_</i> == 0 && is_convertible_v<OtherExtents, extents_type>)</ins> |
260 | 468 | </pre></blockquote> |
261 | 469 | </blockquote> |
| 470 | +<pre> |
| 471 | +template<class LayoutLeftPaddedMapping> |
| 472 | + constexpr explicit(<i>see below</i>) |
| 473 | + mapping(const LayoutLeftPaddedMapping& other); |
| 474 | +</pre> |
| 475 | +<blockquote> |
| 476 | +<p> |
| 477 | +-13- <i>Constraints</i>: […] |
| 478 | +<p/> |
| 479 | +[…] |
| 480 | +<p/> |
| 481 | +-16- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to: |
| 482 | +</p> |
| 483 | +<blockquote><pre> |
| 484 | +<ins>!is_convertible_v<typename LayoutLeftPaddedMapping::extents_type, extents_type> &&</ins> |
| 485 | +rank_> 1 && |
| 486 | +(padding_value != dynamic_extent || |
| 487 | + LayoutLeftPaddedMapping::padding_value == dynamic_extent) |
| 488 | +</pre></blockquote> |
| 489 | +</blockquote> |
262 | 490 | </blockquote> |
263 | 491 | </li> |
264 | 492 |
|
@@ -305,6 +533,26 @@ <h3 id="4272"><a href="lwg-active.html#4272">4272</a>. For <code class='backtick |
305 | 533 | <ins>!(<i>rank_</i> == 0 && is_convertible_v<OtherExtents, extents_type>)</ins> |
306 | 534 | </pre></blockquote> |
307 | 535 | </blockquote> |
| 536 | +<pre> |
| 537 | +template<class LayoutRightPaddedMapping> |
| 538 | + constexpr explicit(<i>see below</i>) |
| 539 | + mapping(const LayoutRightPaddedMapping& other); |
| 540 | +</pre> |
| 541 | +<blockquote> |
| 542 | +<p> |
| 543 | +-13- <i>Constraints</i>: […] |
| 544 | +<p/> |
| 545 | +[…] |
| 546 | +<p/> |
| 547 | +-17- <i>Remarks</i>: The expression inside <code class='backtick'>explicit</code> is equivalent to: |
| 548 | +</p> |
| 549 | +<blockquote><pre> |
| 550 | +<ins>!is_convertible_v<typename LayoutRightPaddedMapping::extents_type, extents_type> &&</ins> |
| 551 | +<i>rank_</i> > 1 && |
| 552 | +(padding_value != dynamic_extent || |
| 553 | +LayoutRightPaddedMapping::padding_value == dynamic_extent) |
| 554 | +</pre></blockquote> |
| 555 | +</blockquote> |
308 | 556 | </blockquote> |
309 | 557 | </li> |
310 | 558 |
|
|
0 commit comments