|
214 | 214 |
|
215 | 215 | // \ref{range.repeat}, repeat view
|
216 | 216 | template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t>
|
217 |
| - requires (is_object_v<T> && @\libconcept{same_as}@<T, remove_cv_t<T>> |
218 |
| - && (@\exposid{is-integer-like}@<Bound> || @\libconcept{same_as}@<Bound, unreachable_sentinel_t>)) |
| 217 | + requires @\seebelow@ |
219 | 218 | class repeat_view; // freestanding
|
220 | 219 |
|
221 | 220 | namespace views { inline constexpr @\unspecnc@ repeat = @\unspecnc@; } // freestanding
|
|
3400 | 3399 |
|
3401 | 3400 | \begin{codeblock}
|
3402 | 3401 | namespace std::ranges {
|
| 3402 | + template<class T> |
| 3403 | + concept @\defexposconceptnc{integer-like-with-usable-difference-type}@ = // \expos |
| 3404 | + @\exposid{is-signed-integer-like}@<T> || (@\exposid{is-integer-like}@<T> && @\libconcept{weakly_incrementable}@<T>); |
| 3405 | + |
3403 | 3406 | template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t>
|
3404 | 3407 | requires (is_object_v<T> && @\libconcept{same_as}@<T, remove_cv_t<T>> &&
|
3405 |
| - (@\exposid{is-integer-like}@<Bound> || @\libconcept{same_as}@<Bound, unreachable_sentinel_t>)) |
| 3408 | + (@\exposconcept{integer-like-with-usable-difference-type}@<Bound> || |
| 3409 | + @\libconcept{same_as}@<Bound, unreachable_sentinel_t>)) |
3406 | 3410 | class @\libglobal{repeat_view}@ : public view_interface<repeat_view<T, Bound>> {
|
3407 | 3411 | private:
|
3408 | 3412 | // \ref{range.repeat.iterator}, class \tcode{repeat_view::\exposid{iterator}}
|
|
3539 | 3543 |
|
3540 | 3544 | \begin{codeblock}
|
3541 | 3545 | namespace std::ranges {
|
3542 |
| - template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> |
| 3546 | + template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound> |
3543 | 3547 | requires (is_object_v<T> && @\libconcept{same_as}@<T, remove_cv_t<T>> &&
|
3544 |
| - (@\exposid{is-integer-like}@<Bound> || @\libconcept{same_as}@<Bound, unreachable_sentinel_t>)) |
| 3548 | + (@\exposconcept{integer-like-with-usable-difference-type}@<Bound> || |
| 3549 | + @\libconcept{same_as}@<Bound, unreachable_sentinel_t>)) |
3545 | 3550 | class repeat_view<T, Bound>::@\exposid{iterator}@ {
|
3546 | 3551 | private:
|
3547 | 3552 | using @\exposidnc{index-type}@ = // \expos
|
|
3555 | 3560 | using iterator_concept = random_access_iterator_tag;
|
3556 | 3561 | using iterator_category = random_access_iterator_tag;
|
3557 | 3562 | using value_type = T;
|
3558 |
| - using difference_type = conditional_t<@\exposid{is-signed-integer-like}@<@\exposid{index-type}@>, |
3559 |
| - @\exposid{index-type}@, |
3560 |
| - @\placeholdernc{IOTA-DIFF-T}@(@\exposid{index-type}@)>; |
| 3563 | + using difference_type = @\seebelow@; |
3561 | 3564 |
|
3562 | 3565 | @\exposid{iterator}@() = default;
|
3563 | 3566 |
|
|
3585 | 3588 | }
|
3586 | 3589 | \end{codeblock}
|
3587 | 3590 |
|
| 3591 | +\pnum |
| 3592 | +If \tcode{\exposid{is-signed-integer-like}<\exposid{index-type}>} is \tcode{true}, |
| 3593 | +the member \grammarterm{typedef-name} \tcode{difference_type} |
| 3594 | +denotes \exposid{index-type}. |
| 3595 | +Otherwise, it denotes \tcode{\placeholdernc{IOTA-DIFF-T}(\exposid{index-type})}\iref{range.iota.view}. |
| 3596 | + |
3588 | 3597 | \indexlibraryctor{repeat_view::\exposid{iterator}}%
|
3589 | 3598 | \begin{itemdecl}
|
3590 | 3599 | constexpr explicit @\exposid{iterator}@(const T* value, @\exposid{index-type}@ b = @\exposid{index-type}@());
|
|
0 commit comments