std::adjacent_find
looks for the first two consecutive elements that satisfies the given predicate. I am looking for other algorithms that also has a predicate that takes the (previous, current) pair. This is useful for rendering polygons, computing numerical quadrature based on sample data etc.
In addition to std::adjacent_find
there is std::adjacent_difference
, which can be used to implement a one-dimensional filter, but is not useful if you only want the sum of op(previous, current).
Can such functions be emulated with some kind of view from std::ranges?