|
160 | 160 |
|
161 | 161 | namespace views { inline constexpr @\unspec@ single = @\unspec@; }
|
162 | 162 |
|
| 163 | + template<bool Const, class T> |
| 164 | + using @\exposid{maybe-const}@ = conditional_t<Const, const T, T>; // \expos |
| 165 | + |
163 | 166 | // \ref{range.iota}, iota view
|
164 | 167 | template<@\libconcept{weakly_incrementable}@ W, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t>
|
165 | 168 | requires @\exposconcept{weakly-equality-comparable-with}@<W, Bound> && semiregular<W>
|
|
4168 | 4171 |
|
4169 | 4172 | constexpr sentinel_t<@\exposid{Base}@> base() const;
|
4170 | 4173 |
|
4171 |
| - friend constexpr bool operator==(const @\exposid{iterator}@<Const>& x, const @\exposid{sentinel}@& y); |
| 4174 | + template<bool OtherConst> |
| 4175 | + requires @\libconcept{sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 4176 | + friend constexpr bool operator==(const @\exposid{iterator}@<OtherConst>& x, const @\exposid{sentinel}@& y); |
4172 | 4177 |
|
4173 |
| - friend constexpr range_difference_t<@\exposid{Base}@> |
4174 |
| - operator-(const @\exposid{iterator}@<Const>& x, const @\exposid{sentinel}@& y) |
4175 |
| - requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{Base}@>>; |
4176 |
| - friend constexpr range_difference_t<@\exposid{Base}@> |
4177 |
| - operator-(const @\exposid{sentinel}@& y, const @\exposid{iterator}@<Const>& x) |
4178 |
| - requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{Base}@>>; |
| 4178 | + template<bool OtherConst> |
| 4179 | + requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 4180 | + friend constexpr range_difference_t<@\exposid{maybe-const}@<OtherConst, V>> |
| 4181 | + operator-(const @\exposid{iterator}@<OtherConst>& x, const @\exposid{sentinel}@& y); |
| 4182 | + |
| 4183 | + template<bool OtherConst> |
| 4184 | + requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 4185 | + friend constexpr range_difference_t<@\exposid{maybe-const}@<OtherConst, V>> |
| 4186 | + operator-(const @\exposid{sentinel}@& y, const @\exposid{iterator}@<OtherConst>& x); |
4179 | 4187 | };
|
4180 | 4188 | }
|
4181 | 4189 | \end{codeblock}
|
|
4216 | 4224 |
|
4217 | 4225 | \indexlibrarymember{operator==}{transform_view::sentinel}
|
4218 | 4226 | \begin{itemdecl}
|
4219 |
| -friend constexpr bool operator==(const @\exposid{iterator}@<Const>& x, const @\exposid{sentinel}@& y); |
| 4227 | +template<bool OtherConst> |
| 4228 | + requires @\libconcept{sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 4229 | +friend constexpr bool operator==(const @\exposid{iterator}@<OtherConst>& x, const @\exposid{sentinel}@& y); |
4220 | 4230 | \end{itemdecl}
|
4221 | 4231 |
|
4222 | 4232 | \begin{itemdescr}
|
|
4227 | 4237 |
|
4228 | 4238 | \indexlibrarymember{operator-}{transform_view::sentinel}%
|
4229 | 4239 | \begin{itemdecl}
|
4230 |
| -friend constexpr range_difference_t<@\exposid{Base}@> |
4231 |
| - operator-(const @\exposid{iterator}@<Const>& x, const @\exposid{sentinel}@& y) |
4232 |
| - requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{Base}@>>; |
| 4240 | +template<bool OtherConst> |
| 4241 | + requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 4242 | +friend constexpr range_difference_t<@\exposid{maybe-const}@<OtherConst, V>> |
| 4243 | + operator-(const @\exposid{iterator}@<OtherConst>& x, const @\exposid{sentinel}@& y); |
4233 | 4244 | \end{itemdecl}
|
4234 | 4245 |
|
4235 | 4246 | \begin{itemdescr}
|
|
4240 | 4251 |
|
4241 | 4252 | \indexlibrarymember{operator-}{transform_view::sentinel}%
|
4242 | 4253 | \begin{itemdecl}
|
4243 |
| -friend constexpr range_difference_t<@\exposid{Base}@> |
4244 |
| - operator-(const @\exposid{sentinel}@& y, const @\exposid{iterator}@<Const>& x) |
4245 |
| - requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{Base}@>>; |
| 4254 | +template<bool OtherConst> |
| 4255 | + requires @\libconcept{sized_sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 4256 | +friend constexpr range_difference_t<@\exposid{maybe-const}@<OtherConst, V>> |
| 4257 | + operator-(const @\exposid{sentinel}@& y, const @\exposid{iterator}@<OtherConst>& x); |
4246 | 4258 | \end{itemdecl}
|
4247 | 4259 |
|
4248 | 4260 | \begin{itemdescr}
|
|
5346 | 5358 | constexpr @\exposid{sentinel}@(@\exposid{sentinel}@<!Const> s)
|
5347 | 5359 | requires Const && @\libconcept{convertible_to}@<sentinel_t<V>, sentinel_t<@\exposid{Base}@>>;
|
5348 | 5360 |
|
5349 |
| - friend constexpr bool operator==(const @\exposid{iterator}@<Const>& x, const @\exposid{sentinel}@& y); |
| 5361 | + template<bool OtherConst> |
| 5362 | + requires @\libconcept{sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 5363 | + friend constexpr bool operator==(const @\exposid{iterator}@<OtherConst>& x, const @\exposid{sentinel}@& y); |
5350 | 5364 | };
|
5351 | 5365 | }
|
5352 | 5366 | \end{codeblock}
|
|
5377 | 5391 | \indexlibrarymember{operator==}{join_view::sentinel}%3431
|
5378 | 5392 |
|
5379 | 5393 | \begin{itemdecl}
|
5380 |
| -friend constexpr bool operator==(const @\exposid{iterator}@<Const>& x, const @\exposid{sentinel}@& y); |
| 5394 | +template<bool OtherConst> |
| 5395 | + requires @\libconcept{sentinel_for}@<sentinel_t<@\exposid{Base}@>, iterator_t<@\exposid{maybe-const}@<OtherConst, V>>> |
| 5396 | +friend constexpr bool operator==(const @\exposid{iterator}@<OtherConst>& x, const @\exposid{sentinel}@& y); |
5381 | 5397 | \end{itemdecl}
|
5382 | 5398 |
|
5383 | 5399 | \begin{itemdescr}
|
|
0 commit comments