ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.15k stars 438 forks source link

Why isn't repeat_n a range adaptor? #1824

Open Mick235711 opened 4 months ago

Mick235711 commented 4 months ago

Currently, views::repeat_n is a range factory that cannot be piped into:

std::vector vec{1, 2, 3};
views::repeat_n(vec, 2); // [[1, 2, 3], [1, 2, 3]]

So this naturally raises the question: why isn't repeat_n an adaptor, such that vec | views::repeat_n(2) is also valid?