Skip to content

Commit 2c0bb85

Browse files
committed
Update P/R for 4066
1 parent 304283e commit 2c0bb85

File tree

1 file changed

+58
-2
lines changed

1 file changed

+58
-2
lines changed

xml/issue4066.xml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,66 @@ input range feels like an extreme corner case."
4545
"This is just applying the contrived case mentioned in LWG <iref ref="3737"/>
4646
to `ranges::to`."
4747
</p>
48+
<superseded>
49+
<p>
50+
This wording is relative to <paper num="N4981"/>.
51+
</p>
52+
53+
<ol>
54+
<li><p>Modify <sref ref="[range.utility.conv.to]"/> as indicated:</p>
55+
56+
<blockquote>
57+
<pre>
58+
template&lt;class C, input_range R, class... Args&gt; requires (!view&lt;C&gt;)
59+
constexpr C to(R&amp;&amp; r, Args&amp;&amp;... args);
60+
</pre>
61+
<blockquote>
62+
<p>
63+
-1- <i>Mandates</i>: <tt>C</tt> is a cv-unqualified class type.
64+
</p>
65+
<p>
66+
-2- <i>Returns</i>: An object of type <tt>C</tt> constructed from the elements of <tt>r</tt> in the following manner:
67+
</p>
68+
<ol style="list-style-type: none">
69+
<li><p>(2.1) &mdash; [&hellip;]</p>
70+
<ol style="list-style-type: none">
71+
<li><p>(2.1.1) &mdash; [&hellip;]</p></li>
72+
<li><p>(2.1.2) &mdash; [&hellip;]</p></li>
73+
<li><p>(2.1.3) &mdash; [&hellip;]</p></li>
74+
<li><p>(2.1.4) &mdash; Otherwise, if</p>
75+
<ol style="list-style-type: none">
76+
<li><p>(2.1.4.1) &mdash; <tt>constructible_from&lt;C, Args...&gt;</tt> is <tt>true</tt>, and</p></li>
77+
<li><p>(2.1.4.2) &mdash; <tt><i>container-appendable</i>&lt;C, range_reference_t&lt;R&gt;&gt;</tt> is
78+
<tt>true</tt>:</p>
79+
<blockquote>
80+
<pre>
81+
C c(std::forward&lt;Args&gt;(args)...);
82+
<ins>subrange s{r};</ins>
83+
if constexpr (<del>sized_range&lt;R&gt;</del><ins>requires { s.size(); }</ins> &amp;&amp; <i>reservable-container</i>&lt;C&gt;)
84+
c.reserve(static_cast&lt;range_size_t&lt;C&gt;&gt;(<del>ranges::size(r)</del><ins>s.size()</ins>));
85+
ranges::for_each(<del>r</del><ins>s</ins>, <i>container-append</i>(c));
86+
</pre>
87+
</blockquote>
88+
</li>
89+
</ol>
90+
</li>
91+
</ol>
92+
</li>
93+
</ol>
94+
</blockquote>
95+
96+
</blockquote>
97+
</li>
98+
</ol>
99+
</superseded>
100+
101+
<note>2025-10-20; Jonathan provides updated wording</note>
102+
48103
</discussion>
49104

50105
<resolution>
51106
<p>
52-
This wording is relative to <paper num="N4981"/>.
107+
This wording is relative to <paper num="N5014"/>.
53108
</p>
54109

55110
<ol>
@@ -82,7 +137,7 @@ template&lt;class C, input_range R, class... Args&gt; requires (!view&lt;C&gt;)
82137
<pre>
83138
C c(std::forward&lt;Args&gt;(args)...);
84139
<ins>subrange s{r};</ins>
85-
if constexpr (<del>sized_range&lt;R&gt;</del><ins>requires { s.size(); }</ins> &amp;&amp; <i>reservable-container</i>&lt;C&gt;)
140+
if constexpr (sized_range&lt;<del>R</del><ins>decltype(s)</ins>&gt; &amp;&amp; <i>reservable-container</i>&lt;C&gt;)
86141
c.reserve(static_cast&lt;range_size_t&lt;C&gt;&gt;(<del>ranges::size(r)</del><ins>s.size()</ins>));
87142
ranges::for_each(<del>r</del><ins>s</ins>, <i>container-append</i>(c));
88143
</pre>
@@ -98,6 +153,7 @@ ranges::for_each(<del>r</del><ins>s</ins>, <i>container-append</i>(c));
98153
</blockquote>
99154
</li>
100155
</ol>
156+
101157
</resolution>
102158

103159
</issue>

0 commit comments

Comments
 (0)