Talk:cpp/algorithm/ranges/iota
From cppreference.com
The example for the second definition of iota
can easily be misread - when I first read the example, I missed the fact that the range being passed was a vector of list iterators. This really confused me because I thought that meant that std::ranges::output_range<R, T>
expected an iterator type as T
, which was contradictory to what I'd previously remembered about output_range
.
While I think it's good to have complex examples that make you think, I think it might be good to also have a more trivial example to establish a basis. Maybe something like std::ranges::iota(l, 0);