[range.chunk.outer.iter]

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

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.chunk.outer.iter)

### 25.7.29 Chunk view [[range.chunk]](range.chunk#outer.iter)

#### 25.7.29.3 Class chunk_view​::​*outer-iterator* [range.chunk.outer.iter]

[ð](#lib:chunk_view::outer-iterator)

namespace std::ranges {template<[view](range.view#concept:view "25.4.5 Views [range.view]") V>requires [input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]")<V>class chunk_view<V>::*outer-iterator* { chunk_view* *parent_*; // *exposition only*constexpr explicit *outer-iterator*(chunk_view& parent); // *exposition only*public:using iterator_concept = input_iterator_tag; using difference_type = range_difference_t<V>; // [[range.chunk.outer.value]](range.chunk.outer.value "25.7.29.4 Class chunk_­view​::​outer-iterator​::​value_­type"), class chunk_view​::​*outer-iterator*​::​value_typestruct value_type; *outer-iterator*(*outer-iterator*&&) = default; *outer-iterator*& operator=(*outer-iterator*&&) = default; constexpr value_type operator*() const; constexpr *outer-iterator*& operator++(); constexpr void operator++(int); friend constexpr bool operator==(const *outer-iterator*& x, default_sentinel_t); friend constexpr difference_type operator-(default_sentinel_t y, const *outer-iterator*& x)requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>; friend constexpr difference_type operator-(const *outer-iterator*& x, default_sentinel_t y)requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>; };}

[ð](#lib:chunk_view::outer-iterator,constructor)

`constexpr explicit outer-iterator(chunk_view& parent);
`

[1](#1)

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

*Effects*: Initializes *parent_* with addressof(parent)[.](#1.sentence-1)

[ð](#lib:operator*,chunk_view::outer-iterator)

`constexpr value_type operator*() const;
`

[2](#2)

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

*Preconditions*: *this == default_sentinel is false[.](#2.sentence-1)

[3](#3)

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

*Returns*: value_type(**parent_*)[.](#3.sentence-1)

[ð](#lib:operator++,chunk_view::outer-iterator)

`constexpr outer-iterator& operator++();
`

[4](#4)

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

*Preconditions*: *this == default_sentinel is false[.](#4.sentence-1)

[5](#5)

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

*Effects*: Equivalent to:ranges::advance(**parent_*->*current_*, *parent_*->*remainder_*, ranges::end(*parent_*->*base_*));*parent_*->*remainder_* = *parent_*->*n_*;return *this;

[ð](#lib:operator++,chunk_view::outer-iterator_)

`constexpr void operator++(int);
`

[6](#6)

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

*Effects*: Equivalent to ++*this[.](#6.sentence-1)

[ð](#lib:operator==,chunk_view::outer-iterator)

`friend constexpr bool operator==(const outer-iterator& x, default_sentinel_t);
`

[7](#7)

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

*Effects*: Equivalent to:return *x.*parent_*->*current_* == ranges::end(x.*parent_*->*base_*) && x.*parent_*->*remainder_* != 0;

[ð](#lib:operator-,chunk_view::outer-iterator)

`friend constexpr difference_type operator-(default_sentinel_t y, const outer-iterator& x)
  requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>;
`

[8](#8)

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

*Effects*: Equivalent to:const auto dist = ranges::end(x.*parent_*->*base_*) - *x.*parent_*->*current_*;if (dist < x.*parent_*->*remainder_*) {return dist == 0 ? 0 : 1;}return *div-ceil*(dist - x.*parent_*->*remainder_*, x.*parent_*->*n_*) + 1;

[ð](#lib:operator-,chunk_view::outer-iterator_)

`friend constexpr difference_type operator-(const outer-iterator& x, default_sentinel_t y)
  requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]")<sentinel_t<V>, iterator_t<V>>;
`

[9](#9)

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

*Effects*: Equivalent to: return -(y - x);
