26 Ranges library [ranges]

26.7 Range adaptors [range.adaptors]

26.7.24 Zip view [range.zip]

26.7.24.1 Overview [range.zip.overview]

zip_view takes any number of views and produces a view of tuples of references to the corresponding elements of the constituent views.
The name views​::​zip denotes a customization point object ([customization.point.object]).
Given a pack of subexpressions Es..., the expression views​::​zip(Es...) is expression-equivalent to
  • auto(views​::​empty<tuple<>>) if Es is an empty pack,
  • otherwise, zip_view<views​::​all_t<decltype((Es))>...>(Es...).
[Example 1: vector v = {1, 2}; list l = {'a', 'b', 'c'}; auto z = views::zip(v, l); range_reference_t<decltype(z)> f = z.front(); // f is a tuple<int&, char&> // that refers to the first element of v and l for (auto&& [x, y] : z) { cout << '(' << x << ", " << y << ") "; // prints (1, a) (2, b) } — end example]