Files
2025-10-25 03:02:53 +03:00

1.3 KiB
Raw Permalink Blame History

[range.stride.overview]

25 Ranges library [ranges]

25.7 Range adaptors [range.adaptors]

25.7.32 Stride view [range.stride]

25.7.32.1 Overview [range.stride.overview]

1

#

stride_view presents a view of an underlying sequence, advancing over n elements at a time, as opposed to the usual single-step succession.

2

#

The name views::stride denotes a range adaptor object ([range.adaptor.object]).

Given subexpressions E and N, the expression views::stride(E, N) is expression-equivalent to stride_view(E, N).

3

#

[Example 1: auto input = views::iota(0, 12) | views::stride(3); ranges::copy(input, ostream_iterator(cout, " ")); // prints 0 3 6 9 ranges::copy(input | views::reverse, ostream_iterator(cout, " ")); // prints 9 6 3 0 — end example]