2.2 KiB
[range.zip.transform.overview]
25 Ranges library [ranges]
25.7 Range adaptors [range.adaptors]
25.7.26 Zip transform view [range.zip.transform]
25.7.26.1 Overview [range.zip.transform.overview]
zip_transform_view takes an invocable object and any number of views and produces a view whose Mth element is the result of applying the invocable object to the Mth elements of all views.
The name views::zip_transform denotes a customization point object ([customization.point.object]).
Let F be a subexpression, and let Es... be a pack of subexpressions.
If move_constructible &®ular_invocable<FD&> is false, or if decay_t<invoke_result_t<FD&>> is not an object type,views::zip_transform(F, Es...) is ill-formed.
Otherwise, the expression views::zip_transform(F, Es...) is expression-equivalent to((void)F, auto(views::empty<decay_t<invoke_result_t<FD&>>>))
-
Otherwise, the expression views::zip_transform(F, Es...) is expression-equivalent to zip_transform_view(F, Es...).
[Example 1: vector v1 = {1, 2}; vector v2 = {4, 5, 6};
for (auto i : views::zip_transform(plus(), v1, v2)) { cout << i << ' '; // prints 5 7} â end example]