t
](/mwiki/index.php?title=cpp/ranges/zip_view&action=edit&section=3 "Edit
section: Deduction guides") ]  [ Deduction guides
](/w/cpp/ranges/zip_view/deduction_guides "cpp/ranges/zip view/deduction
guides")

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/zip_view&action=edit&section=4 "Edit
section: Nested classes") ]  Nested classes

[ _ iterator  _ ](/w/cpp/ranges/zip_view/iterator "cpp/ranges/zip view/iterator") (C++23)  |  the iterator type   
(  exposition-only member class template*  )  
---|---  
[ _ sentinel  _ ](/w/cpp/ranges/zip_view/sentinel "cpp/ranges/zip view/sentinel") (C++23)  |  the sentinel type used when ` zip_view ` is not a [ ` common_range ` ](/w/cpp/ranges/common_range "cpp/ranges/common range")   
(  exposition-only member class template*  )  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/zip_view&action=edit&section=5 "Edit
section: Helper templates") ]  Helper templates

template  < class  ...  Views  >  
inline  constexpr  bool  enable_borrowed_range  < ranges  ::  zip_view  <
Views...  >> =  
(  [ ranges::  enable_borrowed_range  ](http://en.cppreference.com/w/cpp/ranges/borrowed_range) < Views  > && ...  )  ;  |  |  (since C++23)   
---|---|---  
|  |   
  
This specialization of [ ` ranges::enable_borrowed_range `
](/w/cpp/ranges/borrowed_range "cpp/ranges/borrowed range") makes  ` zip_view
` satisfy [ ` borrowed_range ` ](/w/cpp/ranges/borrowed_range
"cpp/ranges/borrowed range") when each underlying view satisfies it.

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/zip_view&action=edit&section=6 "Edit
section: Notes") ]  Notes

[ Feature-test ](/w/cpp/utility/feature_test "cpp/utility/feature test") macro  |  Value  |  Std  |  Feature   
---|---|---|---  
[ ` __cpp_lib_ranges_zip ` ](/w/cpp/feature_test#cpp_lib_ranges_zip "cpp/feature test") |  202110L  |  (C++23)  |  ` std::ranges::zip_view ` ,   
std::ranges::zip_transform_view  ,  
std::ranges::adjacent_view  ,  
std::ranges::adjacent_transform_view  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/zip_view&action=edit&section=7 "Edit
section: Example") ]  Example

Run this code

    
    
    #include <array>
    #include <iostream>
    #include <list>
    #include <ranges>
    #include <string>
    #include <tuple>
    #include <vector>
     
    void print(auto const rem, auto const& range)
    {
        for ([std::cout](http://en.cppreference.com/w/cpp/io/cout) << rem; auto const& elem : range)
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << elem << ' ';
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << '\n';
    }
     
    int main()
    {
        auto x = [std::vector](http://en.cppreference.com/w/cpp/container/vector){1, 2, 3, 4};
        auto y = [std::list](http://en.cppreference.com/w/cpp/container/list)<[std::string](http://en.cppreference.com/w/cpp/string/basic_string)>{"α", "β", "γ", "δ", "ε"};
        auto z = [std::array](http://en.cppreference.com/w/cpp/container/array){'A', 'B', 'C', 'D', 'E', 'F'};
     
        print("Source views:", "");
        print("x: ", x);
        print("y: ", y);
        print("z: ", z);
     
        print("\nzip(x,y,z):", "");
     
        for ([std::tuple](http://en.cppreference.com/w/cpp/utility/tuple)<int&, [std::string](http://en.cppreference.com/w/cpp/string/basic_string)&, char&> elem : std::views::zip(x, y, z))
        {
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << [std::get](http://en.cppreference.com/w/cpp/utility/variant/get)<0>(elem) << ' '
                      << [std::get](http://en.cppreference.com/w/cpp/utility/variant/get)<1>(elem) << ' '
                      << [std::get](http://en.cppreference.com/w/cpp/utility/variant/get)<2>(elem) << '\n';
     
            [std::get](http://en.cppreference.com/w/cpp/utility/variant/get)<char&>(elem) += ('a' - 'A'); // modifies the element of z
        }
     
        print("\nAfter modification, z: ", z);
    }

Output:

    
    
    Source views:
    x: 1 2 3 4