stride_view:: _iterator_ :: _iterator_
](/w/cpp/ranges/stride_view/iterator/iterator "cpp/ranges/stride
view/iterator/iterator")  
[ stride_view:: _iterator_ ::base  ](/w/cpp/ranges/stride_view/iterator/base
"cpp/ranges/stride view/iterator/base")  
[ stride_view:: _iterator_ ::operator*
](/w/cpp/ranges/stride_view/iterator/operator* "cpp/ranges/stride
view/iterator/operator*")  
[ stride_view:: _iterator_ ::operator[]
](/w/cpp/ranges/stride_view/iterator/operator_at "cpp/ranges/stride
view/iterator/operator at")  
[ stride_view:: _iterator_ ::operator++  
stride_view:: _iterator_ ::operator++  (int)  
stride_view:: _iterator_ ::operator--  
stride_view:: _iterator_ ::operator--  (int)  
stride_view:: _iterator_ ::operator+=  
stride_view:: _iterator_ ::operator-=
](/w/cpp/ranges/stride_view/iterator/operator_arith "cpp/ranges/stride
view/iterator/operator arith")  
Non-member functions  
[ operator==  (std::default_sentinel_t)  
operator==  (stride_view:: _iterator_ )  
operator< (stride_view:: _iterator_ )  
operator> (stride_view:: _iterator_ )  
operator<=  (stride_view:: _iterator_ )  
operator>=  (stride_view:: _iterator_ )  
operator<=> (stride_view:: _iterator_ )
](/w/cpp/ranges/stride_view/iterator/operator_cmp "cpp/ranges/stride
view/iterator/operator cmp")  
[ operator+  (stride_view:: _iterator_ )  
operator-  (stride_view:: _iterator_ )
](/w/cpp/ranges/stride_view/iterator/operator_arith2 "cpp/ranges/stride
view/iterator/operator arith2")  
[ iter_move  (stride_view:: _iterator_ )
](/w/cpp/ranges/stride_view/iterator/iter_move "cpp/ranges/stride
view/iterator/iter move")  
[ iter_swap  (stride_view:: _iterator_ )
](/w/cpp/ranges/stride_view/iterator/iter_swap "cpp/ranges/stride
view/iterator/iter swap")  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/stride_view/navbar_content&action=edit)

Defined in header ` [ <ranges> ](/w/cpp/header/ranges "cpp/header/ranges") ` |  |   
---|---|---  
template  < [ ranges::  input_range
](http://en.cppreference.com/w/cpp/ranges/input_range) V  >  
requires [ ranges::  view  ](http://en.cppreference.com/w/cpp/ranges/view) < V
>  
class  stride_view  
:  public  [ ranges::  view_interface  ](http://en.cppreference.com/w/cpp/ranges/view_interface) < stride_view  < V  >> |  (1)  |  (since C++23)   
namespace  views  {  
inline  constexpr  /* unspecified */  stride  =  /* unspecified */  ;  
}  |  (2)  |  (since C++23)   
Call signature  |  |   
template  < [ ranges::  viewable_range
](http://en.cppreference.com/w/cpp/ranges/viewable_range) R  >  
constexpr  [ ranges::  view  ](http://en.cppreference.com/w/cpp/ranges/view) auto  stride  (  R  && r, [ ranges::  range_difference_t  ](http://en.cppreference.com/w/cpp/ranges/iterator_t) < R  > n  )  ;  |  |  (since C++23)   
template  < class  DifferenceType  >  
constexpr  /*range adaptor closure*/  stride  (  DifferenceType  && n  )  ;  |  |  (since C++23)   
Helper templates  |  |   
|  |   
  
1)  ` stride_view ` is a range adaptor that takes a [ ` view `
](/w/cpp/ranges/view "cpp/ranges/view") and a number ` _n_ ` and produces a
view, that consists of elements of the original view by advancing over _n_
elements at a time. This means that each ` _m_ ` _th_ element of the produced
view is ` _(n * i)_ ` th  element of the original view, for some non-negative
index ` _i_ ` . The elements of the original view, whose "index" is not a
multiple of ` _n_ ` , are not present in the produced view.

Let ` _S_ ` be the size of the original view. Then the size of produced view
is:

  * (  S  /  n  )  \+  (  S  %  n  ?  1  :  0  )  , if  S  >=  n  ; otherwise, 
  * 1  , if  S  > 0  ; otherwise, 
  * ​  0  ​  , and the resulting view is empty. 

2)  The name  views  ::  stride  denotes a [ RangeAdaptorObject
](/w/cpp/named_req/RangeAdaptorObject "cpp/named req/RangeAdaptorObject") .
Given subexpressions  e  and  n  , the expression  views  ::  stride  (  e, n
)  is [ expression-equivalent ](/w/cpp/language/exp