@@ -31,9 +31,7 @@ Only matters for pathological types.
3131Maybe use <tt >requires bool_constant< ranges::size(r) < = 1> </tt >.
3232</p >
3333
34- </discussion >
35-
36- <resolution >
34+ <superseded >
3735<p >
3836This wording is relative to <paper num =" N4917" />.
3937</p >
@@ -88,6 +86,94 @@ constexpr lazy_split_view(V base, Pattern pattern);
8886</blockquote >
8987</li >
9088
89+ </ol >
90+ </superseded >
91+
92+ <note >2025-04-27, Hewill provides alternative wording</note >
93+ </discussion >
94+
95+ <resolution >
96+ <p >
97+ This wording is relative to <paper num =" N5008" />.
98+ </p >
99+
100+ <ol >
101+ <li ><p >Modify <sref ref =" [range.lazy.split.view]" /> as indicated:</p >
102+
103+ <blockquote class =" note" >
104+ <p >
105+ [<i >Drafting note:</i > This benefits from <paper num =" P2280" /> that a call to a
106+ member function of a non-constexpr object can be a constant expression if it does
107+ not actually access the member.
108+ <p />
109+ This would make <code >views::lazy_split(r, span< int, 0> {})</code >
110+ well-formed, which can be seen as an enhancement.]
111+ </p >
112+ </blockquote >
113+
114+ <blockquote >
115+ <pre >
116+ namespace std::ranges {
117+ <del >template< auto> struct <i >require-constant</i >; // <i >exposition only</i ></del >
118+
119+ template< class R>
120+ concept <i >tiny-range</i > = // <i >exposition only</i >
121+ sized_range< R> &&
122+ <ins >requires (R& r) { requires bool_constant< ranges::size(r) < = 1> ::value; }</ins >
123+ <del >requires { typename <i >require-constant</i >< remove_reference_t< R> ::size()>; } &&
124+ (remove_reference_t< R> ::size() < = 1)</del >;
125+
126+ template< input_range V, forward_range Pattern>
127+ requires view< V> && view< Pattern> &&
128+ indirectly_comparable< iterator_t< V> , iterator_t< Pattern> , ranges::equal_to> &&
129+ (forward_range< V> || <i >tiny-range</i >< Pattern> )
130+ class lazy_split_view::view_interface< lazy_split_view< V, Pattern>> {
131+ [… ]
132+ };
133+ [… ]
134+ }
135+ </pre >
136+ </blockquote >
137+ </li >
138+
139+ <li ><p >Modify <sref ref =" [range.lazy.split.inner]" /> as indicated:</p >
140+
141+ <blockquote class =" note" >
142+ <p >
143+ [<i >Drafting note:</i >
144+ We can't use <code >if constexpr (ranges::size(<i >i_</i >.<i >parent_</i >-> <i >pattern_</i >) == 0)</code >
145+ here because it is not a constant expression, and it seems more intuitive to just use
146+ <code >ranges::empty</code > which is always well-formed. Note that the PR does not seek the
147+ aggressive optimization that minimizes the instantiation as this is not the intent of the
148+ current design (for example, <code ><i >outer-iterator</i >& operator++()</code > can be
149+ specialized for the case where <code >Pattern::size() == 0</code >), library implementations
150+ are free to optimize as it pleases.]
151+ </p >
152+ </blockquote >
153+
154+ <blockquote >
155+ <pre >
156+ constexpr <i >inner-iterator</i >& operator++();
157+ </pre >
158+ <blockquote >
159+ <p >
160+ -5- <i >Effects:</i > Equivalent to:
161+ </p >
162+ <blockquote ><pre >
163+ <i >incremented_</i > = true;
164+ if constexpr (!forward_range< <i >Base</i >> ) {
165+ <ins >if (ranges::empty(<i >i_</i >.<i >parent_</i >-> <i >pattern_</i >))</ins >
166+ <del >if constexpr (Pattern::size() == 0) {</del >
167+ return *this;
168+ }
169+ }
170+ ++<i >i_</i >.<i >current</i >;
171+ return *this;
172+ </pre ></blockquote >
173+ </blockquote >
174+ </blockquote >
175+ </li >
176+
91177</ol >
92178
93179</resolution >
0 commit comments