[range.slide.overview]

# 25 Ranges library [[ranges]](./#ranges)

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.slide.overview)

### 25.7.30 Slide view [[range.slide]](range.slide#overview)

#### 25.7.30.1 Overview [range.slide.overview]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L14872)

slide_view takes a view and a number N and
produces a view
whose Mth element is a view over
the Mth through(M+Nâ1)th elements
of the original view[.](#1.sentence-1)

If the original view has fewer than N elements,
the resulting view is empty[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L14882)

The name views​::​slide denotes
a range adaptor object ([[range.adaptor.object]](range.adaptor.object "25.7.2 Range adaptor objects"))[.](#2.sentence-1)

Given subexpressions E and N,
the expression views​::​slide(E, N) is expression-equivalent toslide_view(E, N)[.](#2.sentence-2)

[*Example [1](#example-1)*: vector v = {1, 2, 3, 4};

for (auto i : v | views::slide(2)) { cout << '[' << i[0] << ", " << i[1] << "] "; // prints [1, 2] [2, 3] [3, 4]} â *end example*]
