@@ -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" />
4646to `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< class C, input_range R, class... Args> requires (!view< C> )
59+ constexpr C to(R&& r, Args&& ... 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) — [… ]</p >
70+ <ol style =" list-style-type: none" >
71+ <li ><p >(2.1.1) — [… ]</p ></li >
72+ <li ><p >(2.1.2) — [… ]</p ></li >
73+ <li ><p >(2.1.3) — [… ]</p ></li >
74+ <li ><p >(2.1.4) — Otherwise, if</p >
75+ <ol style =" list-style-type: none" >
76+ <li ><p >(2.1.4.1) — <tt >constructible_from< C, Args...> </tt > is <tt >true</tt >, and</p ></li >
77+ <li ><p >(2.1.4.2) — <tt ><i >container-appendable</i >< C, range_reference_t< R>> </tt > is
78+ <tt >true</tt >:</p >
79+ <blockquote >
80+ <pre >
81+ C c(std::forward< Args> (args)...);
82+ <ins >subrange s{r};</ins >
83+ if constexpr (<del >sized_range< R> </del ><ins >requires { s.size(); }</ins > && <i >reservable-container</i >< C> )
84+ c.reserve(static_cast< range_size_t< C>> (<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<class C, input_range R, class... Args> requires (!view<C>)
82137<pre >
83138C c(std::forward< Args> (args)...);
84139<ins >subrange s{r};</ins >
85- if constexpr (< del > sized_range< R > </del ><ins >requires { s.size(); } </ins > && <i >reservable-container</i >< C> )
140+ if constexpr (sized_range< < del >R </del ><ins >decltype(s) </ins >> && <i >reservable-container</i >< C> )
86141 c.reserve(static_cast< range_size_t< C>> (<del >ranges::size(r)</del ><ins >s.size()</ins >));
87142ranges::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