4054. Repeating a repeat_view should repeat the view

Section: 25.6.5.1 [range.repeat.overview] Status: WP Submitter: Tim Song Opened: 2024-02-12 Last modified: 2024-04-02

Priority: Not Prioritized

View all issues with WP status.

Discussion:

views::repeat(views::repeat(5)) should be a view of repeat_views, but it's currently a view of ints due to the use of CTAD in the specification of views::repeat.

[2024-03-12; Reflector poll]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

[Tokyo 2024-03-23; Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4971.

  1. Modify 25.6.5.1 [range.repeat.overview] as indicated:

    -1- repeat_view generates a sequence of elements by repeatedly producing the same value.

    -2- The name views::repeat denotes a customization point object (16.3.3.3.5 [customization.point.object]). Given subexpressions E and F, the expressions views::repeat(E) and views::repeat(E, F) are expression-equivalent to repeat_view<decay_t<decltype((E))>>(E) and repeat_view(E, F), respectively.