Daily bit(e) of C++ | std::views::adjacent_transform
Daily bit(e) of C++ #209, The C++23 view of the applications of an N-ary invocable on consecutive elements: std::views::adjacent_transform.
The C++23 std::view::adjacent_transform is a view that produces elements by continually applying the provided N-ary invocable to each consecutive group of N elements.
The functionality can be simulated by combining std::views::adjacent and std::views::transform, however, this is both less efficient and more cumbersome.