|
243 | 243 | S bound);
|
244 | 244 |
|
245 | 245 | // \ref{range.iter.op.distance}, \tcode{ranges::distance}
|
246 |
| - template<@\libconcept{input_or_output_iterator}@ I, @\libconcept{sentinel_for}@<I> S> |
| 246 | + template<class I, @\libconcept{sentinel_for}@<I> S> |
247 | 247 | requires (!@\libconcept{sized_sentinel_for}@<S, I>)
|
248 | 248 | constexpr iter_difference_t<I> distance(I first, S last); // freestanding
|
249 |
| - template<@\libconcept{input_or_output_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S> |
250 |
| - constexpr iter_difference_t<I> distance(const I& first, const S& last); // freestanding |
| 249 | + template<class I, @\libconcept{sized_sentinel_for}@<decay_t<I>> S> |
| 250 | + constexpr iter_difference_t<decay_t<I>> distance(I&& first, S last); // freestanding |
251 | 251 | template<@\libconcept{range}@ R>
|
252 | 252 | constexpr range_difference_t<R> distance(R&& r); // freestanding
|
253 | 253 |
|
|
3028 | 3028 | \rSec3[range.iter.op.distance]{\tcode{ranges::distance}}
|
3029 | 3029 | \indexlibraryglobal{distance}%
|
3030 | 3030 | \begin{itemdecl}
|
3031 |
| -template<@\libconcept{input_or_output_iterator}@ I, @\libconcept{sentinel_for}@<I> S> |
| 3031 | +template<class I, @\libconcept{sentinel_for}@<I> S> |
3032 | 3032 | requires (!@\libconcept{sized_sentinel_for}@<S, I>)
|
3033 | 3033 | constexpr iter_difference_t<I> ranges::distance(I first, S last);
|
3034 | 3034 | \end{itemdecl}
|
|
3046 | 3046 |
|
3047 | 3047 | \indexlibraryglobal{distance}%
|
3048 | 3048 | \begin{itemdecl}
|
3049 |
| -template<@\libconcept{input_or_output_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S> |
3050 |
| - constexpr iter_difference_t<I> ranges::distance(const I& first, const S& last); |
| 3049 | +template<class I, @\libconcept{sized_sentinel_for}@<decay_t<I>> S> |
| 3050 | + constexpr iter_difference_t<decay_t<I>> ranges::distance(I&& first, S last); |
3051 | 3051 | \end{itemdecl}
|
3052 | 3052 |
|
3053 | 3053 | \begin{itemdescr}
|
3054 | 3054 | \pnum
|
3055 | 3055 | \effects
|
3056 |
| -Equivalent to: \tcode{return last - first;} |
| 3056 | +Equivalent to: \tcode{return last - static_cast<const decay_t<I>\&>(first);} |
3057 | 3057 | \end{itemdescr}
|
3058 | 3058 |
|
3059 | 3059 | \indexlibraryglobal{distance}%
|
|
4236 | 4236 | constexpr Iterator base() &&;
|
4237 | 4237 |
|
4238 | 4238 | constexpr @\exposid{reference}@ operator*() const;
|
4239 |
| - constexpr const value_type* operator->() const |
| 4239 | + constexpr const auto* operator->() const |
4240 | 4240 | requires is_lvalue_reference_v<iter_reference_t<Iterator>> &&
|
4241 | 4241 | @\libconcept{same_as}@<remove_cvref_t<iter_reference_t<Iterator>>, value_type>;
|
4242 | 4242 |
|
|
4256 | 4256 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4257 | 4257 |
|
4258 | 4258 | template<@\libconcept{sentinel_for}@<Iterator> S>
|
4259 |
| - friend constexpr bool operator==(const basic_const_iterator& x, const S& s); |
| 4259 | + constexpr bool operator==(const S& s) const; |
4260 | 4260 |
|
4261 |
| - friend constexpr bool operator<(const basic_const_iterator& x, const basic_const_iterator& y) |
| 4261 | + constexpr bool operator<(const basic_const_iterator& y) const |
4262 | 4262 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4263 |
| - friend constexpr bool operator>(const basic_const_iterator& x, const basic_const_iterator& y) |
| 4263 | + constexpr bool operator>(const basic_const_iterator& y) const |
4264 | 4264 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4265 |
| - friend constexpr bool operator<=(const basic_const_iterator& x, |
4266 |
| - const basic_const_iterator& y) |
| 4265 | + constexpr bool operator<=(const basic_const_iterator& y) const |
4267 | 4266 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4268 |
| - friend constexpr bool operator>=(const basic_const_iterator& x, |
4269 |
| - const basic_const_iterator& y) |
| 4267 | + constexpr bool operator>=(const basic_const_iterator& y) const |
4270 | 4268 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4271 |
| - friend constexpr auto operator<=>(const basic_const_iterator& x, |
4272 |
| - const basic_const_iterator& y) |
| 4269 | + constexpr auto operator<=>(const basic_const_iterator& y) const |
4273 | 4270 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{three_way_comparable}@<Iterator>;
|
4274 | 4271 |
|
4275 | 4272 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4276 |
| - friend constexpr bool operator<(const basic_const_iterator& x, const I& y) |
| 4273 | + constexpr bool operator<(const I& y) const |
4277 | 4274 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4278 | 4275 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4279 |
| - friend constexpr bool operator>(const basic_const_iterator& x, const I& y) |
| 4276 | + constexpr bool operator>(const I& y) const |
4280 | 4277 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4281 | 4278 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4282 |
| - friend constexpr bool operator<=(const basic_const_iterator& x, const I& y) |
| 4279 | + constexpr bool operator<=(const I& y) const |
4283 | 4280 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4284 | 4281 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4285 |
| - friend constexpr bool operator>=(const basic_const_iterator& x, const I& y) |
| 4282 | + constexpr bool operator>=(const I& y) const |
4286 | 4283 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
| 4284 | + template<@\exposconcept{different-from}@<basic_const_iterator> I> |
| 4285 | + constexpr auto operator<=>(const I& y) const |
| 4286 | + requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I> && |
| 4287 | + @\libconcept{three_way_comparable_with}@<Iterator, I>; |
4287 | 4288 | template<@\exposconcept{not-a-const-iterator}@ I>
|
4288 | 4289 | friend constexpr bool operator<(const I& x, const basic_const_iterator& y)
|
4289 | 4290 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
|
4296 | 4297 | template<@\exposconcept{not-a-const-iterator}@ I>
|
4297 | 4298 | friend constexpr bool operator>=(const I& x, const basic_const_iterator& y)
|
4298 | 4299 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4299 |
| - template<@\exposconcept{different-from}@<basic_const_iterator> I> |
4300 |
| - friend constexpr auto operator<=>(const basic_const_iterator& x, const I& y) |
4301 |
| - requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I> && |
4302 |
| - @\libconcept{three_way_comparable_with}@<Iterator, I>; |
4303 | 4300 |
|
4304 | 4301 | friend constexpr basic_const_iterator operator+(const basic_const_iterator& i,
|
4305 | 4302 | difference_type n)
|
|
4311 | 4308 | difference_type n)
|
4312 | 4309 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4313 | 4310 | template<@\libconcept{sized_sentinel_for}@<Iterator> S>
|
4314 |
| - friend constexpr difference_type operator-(const basic_const_iterator& x, const S& y); |
4315 |
| - template<@\libconcept{sized_sentinel_for}@<Iterator> S> |
4316 |
| - requires @\exposconcept{different-from}@<S, basic_const_iterator> |
| 4311 | + constexpr difference_type operator-(const S& y) const; |
| 4312 | + template<@\exposconcept{not-a-const-iterator}@ S> |
| 4313 | + requires @\libconcept{sized_sentinel_for}@<S, Iterator> |
4317 | 4314 | friend constexpr difference_type operator-(const S& x, const basic_const_iterator& y);
|
4318 | 4315 | };
|
4319 | 4316 | }
|
|
4427 | 4424 |
|
4428 | 4425 | \indexlibrarymember{operator->}{basic_const_iterator}%
|
4429 | 4426 | \begin{itemdecl}
|
4430 |
| -constexpr const value_type* operator->() const |
| 4427 | +constexpr const auto* operator->() const |
4431 | 4428 | requires is_lvalue_reference_v<iter_reference_t<Iterator>> &&
|
4432 | 4429 | @\libconcept{same_as}@<remove_cvref_t<iter_reference_t<Iterator>>, value_type>;
|
4433 | 4430 | \end{itemdecl}
|
|
4549 | 4546 | \indexlibrarymember{operator==}{basic_const_iterator}%
|
4550 | 4547 | \begin{itemdecl}
|
4551 | 4548 | template<@\libconcept{sentinel_for}@<Iterator> S>
|
4552 |
| - friend constexpr bool operator==(const basic_const_iterator& x, const S& s); |
| 4549 | + constexpr bool operator==(const S& s) const; |
4553 | 4550 | \end{itemdecl}
|
4554 | 4551 |
|
4555 | 4552 | \begin{itemdescr}
|
4556 | 4553 | \pnum
|
4557 | 4554 | \effects
|
4558 |
| -Equivalent to: \tcode{return x.\exposid{current_} == s;} |
| 4555 | +Equivalent to: \tcode{return \exposid{current_} == s;} |
4559 | 4556 | \end{itemdescr}
|
4560 | 4557 |
|
4561 | 4558 | \indexlibrarymember{operator<}{basic_const_iterator}%
|
|
4564 | 4561 | \indexlibrarymember{operator>=}{basic_const_iterator}%
|
4565 | 4562 | \indexlibrarymember{operator<=>}{basic_const_iterator}%
|
4566 | 4563 | \begin{itemdecl}
|
4567 |
| -friend constexpr bool operator<(const basic_const_iterator& x, const basic_const_iterator& y) |
| 4564 | +constexpr bool operator<(const basic_const_iterator& y) const |
4568 | 4565 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4569 |
| -friend constexpr bool operator>(const basic_const_iterator& x, const basic_const_iterator& y) |
| 4566 | +constexpr bool operator>(const basic_const_iterator& y) const |
4570 | 4567 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4571 |
| -friend constexpr bool operator<=(const basic_const_iterator& x, const basic_const_iterator& y) |
| 4568 | +constexpr bool operator<=(const basic_const_iterator& y) const |
4572 | 4569 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4573 |
| -friend constexpr bool operator>=(const basic_const_iterator& x, const basic_const_iterator& y) |
| 4570 | +constexpr bool operator>=(const basic_const_iterator& y) const |
4574 | 4571 | requires @\libconcept{random_access_iterator}@<Iterator>;
|
4575 |
| -friend constexpr auto operator<=>(const basic_const_iterator& x, const basic_const_iterator& y) |
| 4572 | +constexpr auto operator<=>(const basic_const_iterator& y) const |
4576 | 4573 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{three_way_comparable}@<Iterator>;
|
4577 | 4574 | \end{itemdecl}
|
4578 | 4575 |
|
|
4583 | 4580 | \pnum
|
4584 | 4581 | \effects
|
4585 | 4582 | Equivalent to:
|
4586 |
| -\tcode{return x.\exposid{current_} \placeholder{op} \exposid{y.current_};} |
| 4583 | +\tcode{return \exposid{current_} \placeholder{op} \exposid{y.current_};} |
4587 | 4584 | \end{itemdescr}
|
4588 | 4585 |
|
4589 | 4586 | \indexlibrarymember{operator<}{basic_const_iterator}%
|
|
4593 | 4590 | \indexlibrarymember{operator<=>}{basic_const_iterator}%
|
4594 | 4591 | \begin{itemdecl}
|
4595 | 4592 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4596 |
| - friend constexpr bool operator<(const basic_const_iterator& x, const I& y) |
| 4593 | + constexpr bool operator<(const I& y) const |
4597 | 4594 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4598 | 4595 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4599 |
| - friend constexpr bool operator>(const basic_const_iterator& x, const I& y) |
| 4596 | + constexpr bool operator>(const I& y) const |
4600 | 4597 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4601 | 4598 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4602 |
| - friend constexpr bool operator<=(const basic_const_iterator& x, const I& y) |
| 4599 | + constexpr bool operator<=(const I& y) const |
4603 | 4600 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4604 | 4601 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4605 |
| - friend constexpr bool operator>=(const basic_const_iterator& x, const I& y) |
| 4602 | + constexpr bool operator>=(const I& y) const |
4606 | 4603 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I>;
|
4607 | 4604 | template<@\exposconcept{different-from}@<basic_const_iterator> I>
|
4608 |
| - friend constexpr auto operator<=>(const basic_const_iterator& x, const I& y) |
| 4605 | + constexpr auto operator<=>(const I& y) const |
4609 | 4606 | requires @\libconcept{random_access_iterator}@<Iterator> && @\libconcept{totally_ordered_with}@<Iterator, I> &&
|
4610 | 4607 | @\libconcept{three_way_comparable_with}@<Iterator, I>;
|
4611 | 4608 | \end{itemdecl}
|
|
4615 | 4612 | Let \tcode{\placeholder{op}} be the operator.
|
4616 | 4613 |
|
4617 | 4614 | \pnum
|
4618 |
| -\returns |
4619 |
| -Equivalent to: \tcode{return x.\exposid{current_} \placeholder{op} y;} |
| 4615 | +\effects |
| 4616 | +Equivalent to: \tcode{return \exposid{current_} \placeholder{op} y;} |
4620 | 4617 | \end{itemdescr}
|
4621 | 4618 |
|
4622 | 4619 | \indexlibrarymember{operator<}{basic_const_iterator}%
|
|
4675 | 4672 | \indexlibrarymember{operator-}{basic_const_iterator}%
|
4676 | 4673 | \begin{itemdecl}
|
4677 | 4674 | template<@\libconcept{sized_sentinel_for}@<Iterator> S>
|
4678 |
| - friend constexpr difference_type operator-(const basic_const_iterator& x, const S& y); |
| 4675 | + constexpr difference_type operator-(const S& y) const; |
4679 | 4676 | \end{itemdecl}
|
4680 | 4677 |
|
4681 | 4678 | \begin{itemdescr}
|
4682 | 4679 | \pnum
|
4683 | 4680 | \effects
|
4684 |
| -Equivalent to: \tcode{return x.\exposid{current_} - y;} |
| 4681 | +Equivalent to: \tcode{return \exposid{current_} - y;} |
4685 | 4682 | \end{itemdescr}
|
4686 | 4683 |
|
4687 | 4684 | \indexlibrarymember{operator-}{basic_const_iterator}%
|
4688 | 4685 | \begin{itemdecl}
|
4689 |
| -template<@\libconcept{sized_sentinel_for}@<Iterator> S> |
4690 |
| - requires @\exposconcept{different-from}@<S, basic_const_iterator> |
| 4686 | +template<@\exposconcept{not-a-const-iterator}@ S> |
| 4687 | + requires @\libconcept{sized_sentinel_for}@<S, Iterator> |
4691 | 4688 | friend constexpr difference_type operator-(const S& x, const basic_const_iterator& y);
|
4692 | 4689 | \end{itemdecl}
|
4693 | 4690 |
|
|
0 commit comments