/stride_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_stride ` ](/w/cpp/feature_test#cpp_lib_ranges_stride "cpp/feature test") |  202207L  |  (C++23)  |  ` std::ranges::stride_view `  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/stride_view&action=edit&section=7 "Edit
section: Example") ]  Example

Run this code

    
    
    #include <algorithm>
    #include <iostream>
    #include <ranges>
    #include <string_view>
    using namespace std::literals;
     
    void print(std::[ranges::viewable_range](http://en.cppreference.com/w/cpp/ranges/viewable_range) auto&& v, [std::string_view](http://en.cppreference.com/w/cpp/string/basic_string_view) separator = " ")
    {
        for (auto const& x : v)
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << x << separator;
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << '\n';
    }
     
    int main()
    {
        print(std::[views::iota](http://en.cppreference.com/w/cpp/ranges/iota_view)(1, 13) | std::views::stride(3));
        print(std::[views::iota](http://en.cppreference.com/w/cpp/ranges/iota_view)(1, 13) | std::views::stride(3) | std::[views::reverse](http://en.cppreference.com/w/cpp/ranges/reverse_view));
        print(std::[views::iota](http://en.cppreference.com/w/cpp/ranges/iota_view)(1, 13) | std::[views::reverse](http://en.cppreference.com/w/cpp/ranges/reverse_view) | std::views::stride(3));
     
        print("0x0!133713337*x//42/A$@"sv | std::views::stride(0B11) |
              std::[views::transform](http://en.cppreference.com/w/cpp/ranges/transform_view)([](char O) -> char { return 0100 | O; }),
              "");
    }

Output:

    
    
    1 4 7 10
    10 7 4 1
    12 9 6 3
    password

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/stride_view&action=edit&section=8 "Edit
section: References") ]  References

  * C++23 standard (ISO/IEC 14882:2023): 

    

  * 26.7.31 Stride view [range.stride] 

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/stride_view&action=edit&section=9 "Edit
section: See also") ]  See also

[ ranges::slide_view  views::slide  ](/w/cpp/ranges/slide_view "cpp/ranges/slide view") (C++23)  |  a [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") whose M  th  element is a [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") over the M  th  through (M + N - 1)  th  elements of another [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view")   
(class template)  (range adaptor object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_slide_view&action=edit)  
---|---  
[ ranges::chunk_view  views::chunk  ](/w/cpp/ranges/chunk_view "cpp/ranges/chunk view") (C++23)  |  a range of [ ` view ` s ](/w/cpp/ranges/view "cpp/ranges/view") that are ` N ` -sized non-overlapping successive chunks of the elements of another [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view")   
(class template)  (range adaptor object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_chunk_view&action=edit)  
[ ranges::adjacent_view  views::adjacent  ](/w/cpp/ranges/adjacent_view "cpp/ranges/adjacent view") (C++23)  |  a [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") consisting of tuples of references to adjacent elements of the adapted view   
(class template)  (range adaptor object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_adjacent_view&action=edit)  
[ ranges::filter_view  views::filter  ](/w/cpp/ranges/filter_view "cpp/ranges/filter view") (C++20)  |  a [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") that consists of the elements of a [ ` range ` ](/w/cpp/ranges/range "cpp/ranges/range") that satisfies a predicate   
(class template)  (range adaptor object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_filter