24 Ranges library [ranges]

24.7 Range adaptors [range.adaptors]

24.7.20 Zip transform view [range.zip.transform]

24.7.20.1 Overview [range.zip.transform.overview]

zip_­transform_­view takes an invocable object and any number of views and produces a view whose element is the result of applying the invocable object to the 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 Es is an empty pack, let FD be decay_­t<decltype((F))>.
    • If copy_­constructible<FD> && regular_­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]