[range.chunk.overview]

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

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

### 25.7.29 Chunk view [[range.chunk]](range.chunk#overview)

#### 25.7.29.1 Overview [range.chunk.overview]

[1](#1)

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

chunk_view takes a view and a number N and
produces a range of views
that are N-sized non-overlapping successive chunks of
the elements of the original view, in order[.](#1.sentence-1)

The last view in the range can have fewer than N elements[.](#1.sentence-2)

[2](#2)

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

The name views​::​chunk 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​::​chunk(E, N) is expression-equivalent tochunk_view(E, N)[.](#2.sentence-2)

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

for (auto r : v | views::chunk(2)) { cout << '['; auto sep = ""; for (auto i : r) { cout << sep << i;
 sep = ", "; } cout << "] ";}// The above prints [1, 2] [3, 4] [5] â *end example*]
