[range.adjacent.transform.overview] (original) (raw)

25 Ranges library [ranges]

25.7 Range adaptors [range.adaptors]

25.7.28 Adjacent transform view [range.adjacent.transform]

25.7.28.1 Overview [range.adjacent.transform.overview]

adjacent_transform_view takes an invocable object and a view and produces a view whose element is the result of applying the invocable object to the through elements of the original view.

If the original view has fewer than N elements, the resulting view is empty.

The name views​::​adjacent_transform<N> denotes a range adaptor object ([range.adaptor.object]).

Given subexpressions E and F and a constant expression N:

[Example 1: vector v = {1, 2, 3, 4};for (auto i : v | views::adjacent_transform<2>(std::multiplies())) { cout << i << ' '; } — _end example_]