|
211 | 211 | namespace views { inline constexpr @\unspecnc@ iota = @\unspecnc@; } // freestanding
|
212 | 212 |
|
213 | 213 | // \ref{range.repeat}, repeat view
|
214 |
| - template<@\libconcept{move_constructible}@ W, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> |
215 |
| - requires (is_object_v<W> && @\libconcept{same_as}@<W, remove_cv_t<W>> |
| 214 | + template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> |
| 215 | + requires (is_object_v<T> && @\libconcept{same_as}@<T, remove_cv_t<T>> |
216 | 216 | && (@\exposid{is-integer-like}@<Bound> || @\libconcept{same_as}@<Bound, unreachable_sentinel_t>))
|
217 | 217 | class repeat_view; // freestanding
|
218 | 218 |
|
|
3386 | 3386 |
|
3387 | 3387 | \begin{codeblock}
|
3388 | 3388 | namespace std::ranges {
|
3389 |
| - template<@\libconcept{move_constructible}@ W, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> |
3390 |
| - requires (is_object_v<W> && @\libconcept{same_as}@<W, remove_cv_t<W>> && |
| 3389 | + template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> |
| 3390 | + requires (is_object_v<T> && @\libconcept{same_as}@<T, remove_cv_t<T>> && |
3391 | 3391 | (@\exposid{is-integer-like}@<Bound> || @\libconcept{same_as}@<Bound, unreachable_sentinel_t>))
|
3392 |
| - class @\libglobal{repeat_view}@ : public view_interface<repeat_view<W, Bound>> { |
| 3392 | + class @\libglobal{repeat_view}@ : public view_interface<repeat_view<T, Bound>> { |
3393 | 3393 | private:
|
3394 | 3394 | // \ref{range.repeat.iterator}, class \tcode{repeat_view::\exposid{iterator}}
|
3395 | 3395 | struct @\exposidnc{iterator}@; // \expos
|
3396 | 3396 |
|
3397 |
| - @\exposidnc{movable-box}@<W> @\exposid{value_}@; // \expos, see \ref{range.move.wrap} |
| 3397 | + @\exposidnc{movable-box}@<T> @\exposid{value_}@; // \expos, see \ref{range.move.wrap} |
3398 | 3398 | Bound @\exposid{bound_}@ = Bound(); // \expos
|
3399 | 3399 |
|
3400 | 3400 | public:
|
3401 |
| - repeat_view() requires @\libconcept{default_initializable}@<W> = default; |
| 3401 | + repeat_view() requires @\libconcept{default_initializable}@<T> = default; |
3402 | 3402 |
|
3403 |
| - constexpr explicit repeat_view(const W& value, Bound bound = Bound()) |
3404 |
| - requires @\libconcept{copy_constructible}@<W>; |
3405 |
| - constexpr explicit repeat_view(W&& value, Bound bound = Bound()); |
3406 |
| - template<class... WArgs, class... BoundArgs> |
3407 |
| - requires @\libconcept{constructible_from}@<W, WArgs...> && |
| 3403 | + constexpr explicit repeat_view(const T& value, Bound bound = Bound()) |
| 3404 | + requires @\libconcept{copy_constructible}@<T>; |
| 3405 | + constexpr explicit repeat_view(T&& value, Bound bound = Bound()); |
| 3406 | + template<class... TArgs, class... BoundArgs> |
| 3407 | + requires @\libconcept{constructible_from}@<T, TArgs...> && |
3408 | 3408 | @\libconcept{constructible_from}@<Bound, BoundArgs...>
|
3409 | 3409 | constexpr explicit repeat_view(piecewise_construct_t,
|
3410 |
| - tuple<WArgs...> value_args, tuple<BoundArgs...> bound_args = tuple<>{}); |
| 3410 | + tuple<TArgs...> value_args, tuple<BoundArgs...> bound_args = tuple<>{}); |
3411 | 3411 |
|
3412 | 3412 | constexpr @\exposid{iterator}@ begin() const;
|
3413 | 3413 | constexpr @\exposid{iterator}@ end() const requires (!@\libconcept{same_as}@<Bound, unreachable_sentinel_t>);
|
|
3416 | 3416 | constexpr auto size() const requires (!@\libconcept{same_as}@<Bound, unreachable_sentinel_t>);
|
3417 | 3417 | };
|
3418 | 3418 |
|
3419 |
| - template<class W, class Bound> |
3420 |
| - repeat_view(W, Bound) -> repeat_view<W, Bound>; |
| 3419 | + template<class T, class Bound> |
| 3420 | + repeat_view(T, Bound) -> repeat_view<T, Bound>; |
3421 | 3421 | }
|
3422 | 3422 | \end{codeblock}
|
3423 | 3423 |
|
3424 | 3424 | \indexlibraryctor{repeat_view}%
|
3425 | 3425 | \begin{itemdecl}
|
3426 |
| -constexpr explicit repeat_view(const W& value, Bound bound = Bound()) |
3427 |
| - requires @\libconcept{copy_constructible}@<W>; |
| 3426 | +constexpr explicit repeat_view(const T& value, Bound bound = Bound()) |
| 3427 | + requires @\libconcept{copy_constructible}@<T>; |
3428 | 3428 | \end{itemdecl}
|
3429 | 3429 |
|
3430 | 3430 | \begin{itemdescr}
|
|
3441 | 3441 |
|
3442 | 3442 | \indexlibraryctor{repeat_view}%
|
3443 | 3443 | \begin{itemdecl}
|
3444 |
| -constexpr explicit repeat_view(W&& value, Bound bound = Bound()); |
| 3444 | +constexpr explicit repeat_view(T&& value, Bound bound = Bound()); |
3445 | 3445 | \end{itemdecl}
|
3446 | 3446 |
|
3447 | 3447 | \begin{itemdescr}
|
|
3457 | 3457 |
|
3458 | 3458 | \indexlibraryctor{repeat_view}%
|
3459 | 3459 | \begin{itemdecl}
|
3460 |
| -template<class... WArgs, class... BoundArgs> |
3461 |
| - requires @\libconcept{constructible_from}@<W, WArgs...> && |
| 3460 | +template<class... TArgs, class... BoundArgs> |
| 3461 | + requires @\libconcept{constructible_from}@<T, TArgs...> && |
3462 | 3462 | @\libconcept{constructible_from}@<Bound, BoundArgs...>
|
3463 | 3463 | constexpr explicit repeat_view(piecewise_construct_t,
|
3464 |
| - tuple<Wargs...> value_args, tuple<BoundArgs...> bound_args = tuple<>{}); |
| 3464 | + tuple<TArgs...> value_args, tuple<BoundArgs...> bound_args = tuple<>{}); |
3465 | 3465 | \end{itemdecl}
|
3466 | 3466 |
|
3467 | 3467 | \begin{itemdescr}
|
3468 | 3468 | \pnum
|
3469 | 3469 | \effects
|
3470 |
| -Initializes \exposid{value_} with arguments of types \tcode{WArgs...} |
| 3470 | +Initializes \exposid{value_} with arguments of types \tcode{TArgs...} |
3471 | 3471 | obtained by forwarding the elements of \tcode{value_args} and
|
3472 | 3472 | initializes \exposid{bound_} with arguments of types \tcode{BoundArgs...}
|
3473 | 3473 | obtained by forwarding the elements of \tcode{bound_args}.
|
|
3523 | 3523 |
|
3524 | 3524 | \begin{codeblock}
|
3525 | 3525 | namespace std::ranges {
|
3526 |
| - template<@\libconcept{move_constructible}@ W, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> |
3527 |
| - requires (is_object_v<W> && @\libconcept{same_as}@<W, remove_cv_t<W>> && |
| 3526 | + template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> |
| 3527 | + requires (is_object_v<T> && @\libconcept{same_as}@<T, remove_cv_t<T>> && |
3528 | 3528 | (@\exposid{is-integer-like}@<Bound> || @\libconcept{same_as}@<Bound, unreachable_sentinel_t>))
|
3529 |
| - class repeat_view<W, Bound>::@\exposid{iterator}@ { |
| 3529 | + class repeat_view<T, Bound>::@\exposid{iterator}@ { |
3530 | 3530 | private:
|
3531 | 3531 | using @\exposidnc{index-type}@ = // \expos
|
3532 | 3532 | conditional_t<@\libconcept{same_as}@<Bound, unreachable_sentinel_t>, ptrdiff_t, Bound>;
|
3533 |
| - const W* @\exposidnc{value_}@ = nullptr; // \expos |
| 3533 | + const T* @\exposidnc{value_}@ = nullptr; // \expos |
3534 | 3534 | @\exposidnc{index-type}@ @\exposidnc{current_}@ = @\exposidnc{index-type}@(); // \expos
|
3535 | 3535 |
|
3536 |
| - constexpr explicit @\exposid{iterator}@(const W* value, @\exposid{index-type}@ b = @\exposidnc{index-type}@()); // \expos |
| 3536 | + constexpr explicit @\exposid{iterator}@(const T* value, @\exposid{index-type}@ b = @\exposidnc{index-type}@()); // \expos |
3537 | 3537 |
|
3538 | 3538 | public:
|
3539 | 3539 | using iterator_concept = random_access_iterator_tag;
|
3540 | 3540 | using iterator_category = random_access_iterator_tag;
|
3541 |
| - using value_type = W; |
| 3541 | + using value_type = T; |
3542 | 3542 | using difference_type = conditional_t<@\exposid{is-signed-integer-like}@<@\exposid{index-type}@>,
|
3543 | 3543 | @\exposid{index-type}@,
|
3544 | 3544 | @\placeholdernc{IOTA-DIFF-T}@(@\exposid{index-type}@)>;
|
3545 | 3545 |
|
3546 | 3546 | @\exposid{iterator}@() = default;
|
3547 | 3547 |
|
3548 |
| - constexpr const W& operator*() const noexcept; |
| 3548 | + constexpr const T& operator*() const noexcept; |
3549 | 3549 |
|
3550 | 3550 | constexpr @\exposid{iterator}@& operator++();
|
3551 | 3551 | constexpr @\exposid{iterator}@ operator++(int);
|
|
3555 | 3555 |
|
3556 | 3556 | constexpr @\exposid{iterator}@& operator+=(difference_type n);
|
3557 | 3557 | constexpr @\exposid{iterator}@& operator-=(difference_type n);
|
3558 |
| - constexpr const W& operator[](difference_type n) const noexcept; |
| 3558 | + constexpr const T& operator[](difference_type n) const noexcept; |
3559 | 3559 |
|
3560 | 3560 | friend constexpr bool operator==(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y);
|
3561 | 3561 | friend constexpr auto operator<=>(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y);
|
|
3571 | 3571 |
|
3572 | 3572 | \indexlibraryctor{repeat_view::\exposid{iterator}}%
|
3573 | 3573 | \begin{itemdecl}
|
3574 |
| -constexpr explicit @\exposid{iterator}@(const W* value, @\exposid{index-type}@ b = @\exposid{index-type}@()); |
| 3574 | +constexpr explicit @\exposid{iterator}@(const T* value, @\exposid{index-type}@ b = @\exposid{index-type}@()); |
3575 | 3575 | \end{itemdecl}
|
3576 | 3576 |
|
3577 | 3577 | \begin{itemdescr}
|
|
3587 | 3587 |
|
3588 | 3588 | \indexlibrarymember{operator*}{repeat_view::\exposid{iterator}}%
|
3589 | 3589 | \begin{itemdecl}
|
3590 |
| -constexpr const W& operator*() const noexcept; |
| 3590 | +constexpr const T& operator*() const noexcept; |
3591 | 3591 | \end{itemdecl}
|
3592 | 3592 |
|
3593 | 3593 | \begin{itemdescr}
|
|
3705 | 3705 |
|
3706 | 3706 | \indexlibrarymember{operator[]}{repeat_view::\exposid{iterator}}%
|
3707 | 3707 | \begin{itemdecl}
|
3708 |
| -constexpr const W& operator[](difference_type n) const noexcept; |
| 3708 | +constexpr const T& operator[](difference_type n) const noexcept; |
3709 | 3709 | \end{itemdecl}
|
3710 | 3710 |
|
3711 | 3711 | \begin{itemdescr}
|
|
0 commit comments