Skip to content

Commit e722b0f

Browse files
committed
New issue from Hewill: "Improve span(R&& r)"
1 parent 2c0bbee commit e722b0f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

xml/issue4397.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4397" status="New">
5+
<title>Improve <code>span(R&amp;&amp; r)</code></title>
6+
<section><sref ref="[span.cons]"/></section>
7+
<submitter>Hewill Kang</submitter>
8+
<date>02 Oct 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<p>
13+
It is preferable to reject <code>span&lt;int, 42&gt;(views::empty&lt;int&gt;)</code>
14+
at compile-time after <paper num="P2280R4"/>, since applying `ranges::size` on those
15+
ranges is a constant expression now.
16+
</p>
17+
</discussion>
18+
19+
<resolution>
20+
<p>
21+
This wording is relative to <paper num="N5014"/>.
22+
</p>
23+
24+
<ol>
25+
26+
<li><p>Modify <sref ref="[span.cons]"/> as indicated:</p>
27+
28+
<blockquote>
29+
<pre>
30+
template&lt;class R&gt; constexpr explicit(extent != dynamic_extent) span(R&amp;&amp; r);
31+
</pre>
32+
<blockquote>
33+
<p>
34+
<ins>-?- <i>Mandates</i>: If `extent` is not equal to `dynamic_extent` and `ranges::size(r)` is a
35+
constant expression, then `ranges::size(r) == extent` is `true`.</ins>
36+
<p/>
37+
-16- <i>Constraints</i>: Let `U` be <code>remove_reference_t&lt;ranges::range_reference_t&lt;R&gt;&gt;</code>.
38+
[&hellip;]
39+
</p>
40+
</blockquote>
41+
</blockquote>
42+
</li>
43+
</ol>
44+
45+
</resolution>
46+
47+
</issue>

0 commit comments

Comments
 (0)