Skip to content

Commit 27ce49f

Browse files
committed
New issue from Jonathan: std::text_encoding::aliases_view should have constexpr iterators
1 parent e994b68 commit 27ce49f

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

xml/issue4038.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4038" status="New">
5+
<title><code>std::text_encoding::aliases_view</code> should have constexpr iterators</title>
6+
<section><sref ref="[text.encoding.aliases]"/></section>
7+
<submitter>Jonathan Wakely</submitter>
8+
<date>16 Jan 2024</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<p>
13+
<code>aliases_view::begin()</code> and <code>aliases_view::end()</code>
14+
are constexpr functions, but there is no requirement that you can use
15+
the returned iterator and sentinel in constant expressions.
16+
</p>
17+
</discussion>
18+
19+
<resolution>
20+
<p>
21+
This wording is relative to <paper num="N4971"/>.
22+
</p>
23+
24+
<ol>
25+
<li><p>Modify <sref ref="[text.encoding.aliases]"/> as indicated:</p>
26+
27+
<blockquote>
28+
<blockquote>
29+
<pre>
30+
struct text_encoding::aliases_view : ranges::view_interface&lt;text_encoding::aliases_view&gt; {
31+
constexpr <i>implementation-defined</i> begin() const;
32+
constexpr <i>implementation-defined</i> end() const;
33+
};
34+
</pre>
35+
</blockquote>
36+
<p>
37+
-1-
38+
<code>text_encoding::aliases_view</code> models <code>copyable</code>,
39+
<code>ranges::view</code>, <code>ranges::random_access_range</code>,
40+
and <code>ranges::borrowed_range</code>.
41+
</p>
42+
<p>
43+
-2-
44+
Both <code>ranges::range_value_t&lt;text_encoding::aliases_view&gt;</code>
45+
and <code>ranges::range_reference_t&lt;text_encoding::aliases_view&gt;</code>
46+
denote <code>const char*</code>.
47+
</p>
48+
<p>
49+
<ins>
50+
-?-
51+
<code>ranges::iterator_t&lt;text_encoding::aliases_view&gt;</code>
52+
is a constexpr iterator (<sref ref="[iterator.requirements.general]"/>).
53+
</ins>
54+
</p>
55+
</blockquote>
56+
</li>
57+
</ol>
58+
</resolution>
59+
60+
</issue>

0 commit comments

Comments
 (0)