e size of produced view is:

  * s  \-  n  \+  1  , if  s  >=  n  , 
  * ​  0  ​  otherwise, and the resulting view is empty. 

2)  The name  views  ::  slide  denotes a [ RangeAdaptorObject
](/w/cpp/named_req/RangeAdaptorObject "cpp/named req/RangeAdaptorObject") .
Given subexpressions  e  and  n  , the expression  views  ::  slide  (  e, n
)  is [ expression-equivalent ](/w/cpp/language/expressions#Expression-
equivalence "cpp/language/expressions") to  slide_view  (  e, n  )  .

If  n  is not greater than  ​  0  ​  , the behavior is undefined.

` slide_view ` always models [ ` forward_range ` ](/w/cpp/ranges/forward_range
"cpp/ranges/forward range") , and models [ ` bidirectional_range `
](/w/cpp/ranges/bidirectional_range "cpp/ranges/bidirectional range") , [ `
random_access_range ` ](/w/cpp/ranges/random_access_range "cpp/ranges/random
access range") , or [ ` sized_range ` ](/w/cpp/ranges/sized_range
"cpp/ranges/sized range") if adapted [ ` view ` ](/w/cpp/ranges/view
"cpp/ranges/view") type models the corresponding concept.

##  Contents

  * 1  Data members 
  * 2  Member functions 
    * 2.1  Inherited from  std::ranges::view_interface 
  * 3  Deduction guides 
  * 4  Nested classes 
  * 5  Helper templates 
  * 6  Notes 
  * 7  Example 
  * 8  References 
  * 9  See also 

  
---  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/slide_view&action=edit&section=1 "Edit
section: Data members") ]  Data members

Member object  |  Definition   
---|---  
` _base__ ` (private)  |  The underlying [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") of type ` V ` .   
(  exposition-only member object*  )  
` _n__ ` (private)  |  The "window size" of type  [ ranges::  range_difference_t  ](http://en.cppreference.com/w/cpp/ranges/iterator_t) < V  > .   
(  exposition-only member object*  )  
` _cached_begin__ ` (private)  
(optional)  |  An [ optional-like ](/w/cpp/ranges#Non-propagating_cache "cpp/ranges") object. Present only if ` V ` models the ` ___slide_caches_first_ ` (4)  .   
(  exposition-only member object*  )  
` _cached_end__ ` (private)  
(optional)  |  An [ optional-like ](/w/cpp/ranges#Non-propagating_cache "cpp/ranges") object. Present only if ` V ` models the ` ___slide_caches_last_ ` (5)  .   
(  exposition-only member object*  )  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/slide_view&action=edit&section=2 "Edit
section: Member functions") ]  Member functions

[ (constructor)  ](/w/cpp/ranges/slide_view/slide_view "cpp/ranges/slide view/slide view") (C++23)  |  constructs a ` slide_view `   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_constructor&action=edit)  
---|---  
[ begin  ](/w/cpp/ranges/slide_view/begin "cpp/ranges/slide view/begin") (C++23)  |  returns an iterator to the beginning   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_begin&action=edit)  
[ end  ](/w/cpp/ranges/slide_view/end "cpp/ranges/slide view/end") (C++23)  |  returns an iterator or a sentinel to the end   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_end&action=edit)  
[ size  ](/w/cpp/ranges/slide_view/size "cpp/ranges/slide view/size") (C++23)  |  returns the number of elements. Provided only if the underlying (adapted) range satisfies [ ` sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") .   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_size&action=edit)  
  
#####  Inherited from  [ std::ranges::view_interface
](/w/cpp/ranges/view_interface "cpp/ranges/view interface")  
  
[ empty  ](/w/cpp/ranges/view_interface/empty "cpp/ranges/view interface/empty") (C++20)  |  returns whether the derived view is empty. Provided if it satisfies [ ` sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") or [ `