hpx icon indicating copy to clipboard operation
hpx copied to clipboard

Implement stride_view from P1899 (experimental)

Open gonidelis opened this issue 3 years ago • 0 comments

Although ranges and a part of views have been adopted to C++20 there are certain range adaptors (views) that have not been standardized yet. P1899 proposes stride_view which exposes a strided iterator that iterates through a range with a constant step allowing access over an evenly-spaced subset of it.

Use case example:

auto x = std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};

// prints 0 3 6 9
stdr::copy(stdv::stride(x, 3), std::ostream_iterator<int>(std::cout, " "));

Implement stride_view according to p1899.

Possible extension of the issue to a collection of C++23 minor proposed facilities.

gonidelis avatar Jan 25 '22 06:01 gonidelis

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 08:08 stale[bot]