The Frozen Secrets Of The Forgotten Alpine WW1 Front | Frozen Secrets
Комментарии
wouldn't it make more sense to have an "adjacent_iterator<N>" and simply use it with all the regular algorithms?
AxelStrem
Hmm.. thinking about the new ranges, it looks like you're after some transform that takes the first range and gives you a bunch of sub-ranges of n consecutive items.
It's a bit like a sliding-window range adaptor, could be really useful for convolutions!
Dth
Why even bother with tuple<T>, if you can use array<T, N>?
ashvardanian
As it was mentioned, your version is not terribly nice for forward_iterators.
However, the std::next(first, Is) trick is really cool and it will be faster for random access (just replace the container type and give it more arguments to work on).
Really nit trick.
Maybe passing adjacent elements as a range would be better though.
denisyaroshevskiy
Why not deduce the arity of the function and use it instead of explicit N.
Voy
Meh. Weird approach. Create an iterator that consumes in N-ary chunks, then you can use all the algorithms...