Skip to content

Commit 2523feb

Browse files
author
github-actions
committed
Automatic update from GitHub Actions workflow
1 parent 1fbb185 commit 2523feb

22 files changed

+361
-41
lines changed

issue4221.html

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Issue 4221: Cannot format const-iterable only ranges</title>
6+
<meta property="og:title" content="Issue 4221: Cannot format const-iterable only ranges">
7+
<meta property="og:description" content="C++ library issue. Status: New">
8+
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue4221.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="4221"><a href="lwg-active.html#4221">4221</a>. Cannot format const-iterable only ranges</h3>
66+
<p><b>Section:</b> 28.5.7 <a href="https://wg21.link/format.range">[format.range]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
67+
<b>Submitter:</b> Hewill Kang <b>Opened:</b> 2025-03-06 <b>Last modified:</b> 2025-03-09</p>
68+
<p><b>Priority: </b>Not Prioritized
69+
</p>
70+
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
71+
<p><b>Discussion:</b></p>
72+
<p>
73+
The standard does not explicitly prohibit ranges that are only const-iterable, i.e. a range with
74+
<code>const begin()</code> and deleted or invalid non-<code>const begin()</code>.
75+
</p>
76+
<p>
77+
Unfortunately, those ranges cannot be formatted because the <code>R</code> in
78+
<code>formatter&lt;R&gt;</code> is always without the <code>const</code>-qualifier,
79+
which makes it never satisfy the <code>range</code> concept
80+
(<a href="https://godbolt.org/z/68T6EjKG4">demo</a>):
81+
</p>
82+
<blockquote><pre>
83+
#include &lt;print&gt;
84+
#include &lt;ranges&gt;
85+
86+
struct R {
87+
int* begin() = delete;
88+
int* end() = delete;
89+
const int* begin() const;
90+
const int* end() const;
91+
};
92+
93+
int main() {
94+
const R r;
95+
static_assert(std::ranges::contiguous_range&lt;decltype(r)&gt;);
96+
97+
for (auto&amp;&amp; elem : r)
98+
std::print("{} ", elem); // ok
99+
100+
std::ranges::for_each(
101+
r, [](auto&amp;&amp; elem) { std::print("{} ", elem); }
102+
); // ok
103+
104+
std::print("{}", r); // <span style="color:red;font-weight:bolder">not ok</span>
105+
}
106+
</pre></blockquote>
107+
<p>
108+
Although such type might be relatively rare, it does reflect an inconsistency in the general usage of formatting
109+
ranges, which do not support all valid ranges.
110+
</p>
111+
112+
113+
<p id="res-4221"><b>Proposed resolution:</b></p>
114+
115+
116+
117+
118+
119+
</body>
120+
</html>

lwg-active.html

Lines changed: 60 additions & 5 deletions
Large diffs are not rendered by default.

lwg-closed.html

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

lwg-defects.html

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

lwg-immediate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h1>C++ Standard Library Issues Resolved Directly In [INSERT CURRENT MEETING HER
6262
</tr>
6363
<tr>
6464
<td align="left">Date:</td>
65-
<td align="left">Revised 2025-03-09 at 10:46:46 UTC
65+
<td align="left">Revised 2025-03-09 at 10:56:36 UTC
6666
</td>
6767
</tr>
6868
<tr>

lwg-index-open.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h1>Index by Section</h1>
6666
<p>This document is the Index by Section for the <a href="lwg-active.html">Library Active Issues List</a>.</p>
6767
<h2>Index by Section (non-Ready active issues only)</h2>
6868
<p><a href="lwg-index.html">(view all issues)</a></p>
69-
<p>Revised 2025-03-09 at 10:46:46 UTC
69+
<p>Revised 2025-03-09 at 10:56:36 UTC
7070
</p><h2 id="Section_3">Section 3 (2 issues)</h2>
7171
<p><a href="lwg-index.html#Section_3">(view all issues)</a></p>
7272
<table class="issues-index">
@@ -3897,7 +3897,7 @@ <h2 id="Section_27">Section 27 (18 issues)</h2>
38973897
<td></td>
38983898
</tr>
38993899
</table>
3900-
<h2 id="Section_28">Section 28 (51 issues)</h2>
3900+
<h2 id="Section_28">Section 28 (52 issues)</h2>
39013901
<p><a href="lwg-index.html#Section_28">(view all issues)</a></p>
39023902
<table class="issues-index">
39033903
<tr>
@@ -4171,6 +4171,15 @@ <h2 id="Section_28">Section 28 (51 issues)</h2>
41714171
<td></td>
41724172
</tr>
41734173
<tr>
4174+
<td id="4221"><a href="lwg-active.html#4221" title="Cannot format const-iterable only ranges (Status: New)">4221</a><sup><a href="https://cplusplus.github.io/LWG/issue4221">(i)</a></sup></td>
4175+
<td><a href="lwg-active.html#New">New</a></td>
4176+
<td>28.5.7 [format.range]<a id="format.range"></a></td>
4177+
<td>Cannot format const-iterable only ranges</td>
4178+
<td><span class="no-pr">No</span></td>
4179+
<td></td>
4180+
<td></td>
4181+
</tr>
4182+
<tr>
41744183
<td id="4107"><a href="lwg-active.html#4107" title="Map formatter may conflict with user-defined specializations of pair/tuple formatters (Status: New)">4107</a><sup><a href="https://cplusplus.github.io/LWG/issue4107">(i)</a></sup></td>
41754184
<td><a href="lwg-active.html#New">New</a></td>
41764185
<td>28.5.7.4 [format.range.fmtmap]<a id="format.range.fmtmap"></a></td>

lwg-index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h1>Index by Section</h1>
6666
<p>This document is the Index by Section for the <a href="lwg-active.html">Library Active Issues List</a>, <a href="lwg-defects.html">Library Defect Reports and Accepted Issues</a>, and <a href="lwg-closed.html">Library Closed Issues List</a>.</p>
6767
<h2>Index by Section</h2>
6868
<p><a href="lwg-index-open.html">(view only non-Ready open issues)</a></p>
69-
<p>Revised 2025-03-09 at 10:46:46 UTC
69+
<p>Revised 2025-03-09 at 10:56:36 UTC
7070
</p><h2 id="Section_2">Section 2 (2 issues)</h2>
7171
<table class="issues-index">
7272
<tr>
@@ -20892,7 +20892,7 @@ <h2 id="Section_27">Section 27 (150 issues)</h2>
2089220892
<td></td>
2089320893
</tr>
2089420894
</table>
20895-
<h2 id="Section_28">Section 28 (280 issues)</h2>
20895+
<h2 id="Section_28">Section 28 (281 issues)</h2>
2089620896
<p><a href="lwg-index-open.html#Section_28">(view only non-Ready open issues)</a></p>
2089720897
<table class="issues-index">
2089820898
<tr>
@@ -22592,6 +22592,15 @@ <h2 id="Section_28">Section 28 (280 issues)</h2>
2259222592
<td></td>
2259322593
</tr>
2259422594
<tr>
22595+
<td id="4221"><a href="lwg-active.html#4221" title="Cannot format const-iterable only ranges (Status: New)">4221</a><sup><a href="https://cplusplus.github.io/LWG/issue4221">(i)</a></sup></td>
22596+
<td><a href="lwg-active.html#New">New</a></td>
22597+
<td>28.5.7 [format.range]<a id="format.range"></a></td>
22598+
<td>Cannot format const-iterable only ranges</td>
22599+
<td><span class="no-pr">No</span></td>
22600+
<td></td>
22601+
<td></td>
22602+
</tr>
22603+
<tr>
2259522604
<td id="3892"><a href="lwg-defects.html#3892" title="Incorrect formatting of nested ranges and tuples (Status: WP)">3892</a><sup><a href="https://cplusplus.github.io/LWG/issue3892">(i)</a></sup></td>
2259622605
<td><a href="lwg-active.html#WP">WP</a></td>
2259722606
<td>28.5.7.2 [format.range.formatter]<a id="format.range.formatter"></a></td>

lwg-ready.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h1>C++ Standard Library Issues to be moved in [INSERT CURRENT MEETING HERE]</h1
6262
</tr>
6363
<tr>
6464
<td align="left">Date:</td>
65-
<td align="left">Revised 2025-03-09 at 10:46:46 UTC
65+
<td align="left">Revised 2025-03-09 at 10:56:36 UTC
6666
</td>
6767
</tr>
6868
<tr>

lwg-status-date.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h1>Index by Status and Date</h1>
6767
This document is the Index by Status and Date for the <a href="lwg-active.html">Library Active Issues List</a>,
6868
<a href="lwg-defects.html">Library Defect Reports and Accepted Issues</a>, and <a href="lwg-closed.html">Library Closed Issues List</a>.
6969
</p>
70-
<p>Revised 2025-03-09 at 10:46:46 UTC
70+
<p>Revised 2025-03-09 at 10:56:36 UTC
7171
</p><h2 id="Ready">Ready (7 issues)</h2>
7272
<table class="issues-index">
7373
<tr>
@@ -302,7 +302,7 @@ <h2 id="Tentatively_NAD">Tentatively NAD (12 issues)</h2>
302302
<td></td>
303303
</tr>
304304
</table>
305-
<h2 id="New">New (458 issues)</h2>
305+
<h2 id="New">New (459 issues)</h2>
306306
<table class="issues-index">
307307
<tr>
308308
<th><a href="lwg-toc.html">Issue</a></th>
@@ -359,6 +359,15 @@ <h2 id="New">New (458 issues)</h2>
359359
<td></td>
360360
</tr>
361361
<tr>
362+
<td id="4221"><a href="lwg-active.html#4221" title="Cannot format const-iterable only ranges (Status: New)">4221</a><sup><a href="https://cplusplus.github.io/LWG/issue4221">(i)</a></sup></td>
363+
<td><a href="lwg-active.html#New">New</a></td>
364+
<td>28.5.7 [format.range]</td>
365+
<td>Cannot format const-iterable only ranges</td>
366+
<td><span class="no-pr">No</span></td>
367+
<td></td>
368+
<td></td>
369+
</tr>
370+
<tr>
362371
<td id="4216"><a href="lwg-active.html#4216" title="num_put::do_put and void pointers (Status: New)">4216</a><sup><a href="https://cplusplus.github.io/LWG/issue4216">(i)</a></sup></td>
363372
<td><a href="lwg-active.html#New">New</a></td>
364373
<td>28.3.4.3.3.3 [facet.num.put.virtuals]</td>

lwg-status.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h1>Index by Status and Section</h1>
6262
<a href="lwg-defects.html">Library Defect Reports and Accepted Issues</a>, and <a href="lwg-closed.html">Library Closed Issues List</a>.
6363
</p>
6464

65-
<p>Revised 2025-03-09 at 10:46:46 UTC
65+
<p>Revised 2025-03-09 at 10:56:36 UTC
6666
</p><h2 id="Ready">Ready (7 issues)</h2>
6767
<table class="issues-index">
6868
<tr>
@@ -297,7 +297,7 @@ <h2 id="Tentatively_NAD">Tentatively NAD (12 issues)</h2>
297297
<td></td>
298298
</tr>
299299
</table>
300-
<h2 id="New">New (458 issues)</h2>
300+
<h2 id="New">New (459 issues)</h2>
301301
<table class="issues-index">
302302
<tr>
303303
<th><a href="lwg-toc.html">Issue</a></th>
@@ -3382,6 +3382,15 @@ <h2 id="New">New (458 issues)</h2>
33823382
<td></td>
33833383
</tr>
33843384
<tr>
3385+
<td id="4221"><a href="lwg-active.html#4221" title="Cannot format const-iterable only ranges (Status: New)">4221</a><sup><a href="https://cplusplus.github.io/LWG/issue4221">(i)</a></sup></td>
3386+
<td><a href="lwg-active.html#New">New</a></td>
3387+
<td>28.5.7 [format.range]</td>
3388+
<td>Cannot format const-iterable only ranges</td>
3389+
<td><span class="no-pr">No</span></td>
3390+
<td></td>
3391+
<td></td>
3392+
</tr>
3393+
<tr>
33853394
<td id="4107"><a href="lwg-active.html#4107" title="Map formatter may conflict with user-defined specializations of pair/tuple formatters (Status: New)">4107</a><sup><a href="https://cplusplus.github.io/LWG/issue4107">(i)</a></sup></td>
33863395
<td><a href="lwg-active.html#New">New</a></td>
33873396
<td>28.5.7.4 [format.range.fmtmap]</td>

0 commit comments

Comments
 (0)