[range.split.iterator]

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

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.split.iterator)

### 25.7.17 Split view [[range.split]](range.split#iterator)

#### 25.7.17.3 Class split_view​::​*iterator* [range.split.iterator]

[ð](#lib:split_view::iterator)

namespace std::ranges {template<[forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]") V, [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]") Pattern>requires [view](range.view#concept:view "25.4.5 Views [range.view]")<V> && [view](range.view#concept:view "25.4.5 Views [range.view]")<Pattern> &&[indirectly_comparable](alg.req.ind.cmp#concept:indirectly_comparable "24.3.7.5 Concept indirectly_­comparable [alg.req.ind.cmp]")<iterator_t<V>, iterator_t<Pattern>, ranges::equal_to>class split_view<V, Pattern>::*iterator* {private: split_view* *parent_* = nullptr; // *exposition only* iterator_t<V> *cur_* = iterator_t<V>(); // *exposition only* subrange<iterator_t<V>> *next_* = subrange<iterator_t<V>>(); // *exposition only*bool *trailing_empty_* = false; // *exposition only*public:using iterator_concept = forward_iterator_tag; using iterator_category = input_iterator_tag; using value_type = subrange<iterator_t<V>>; using difference_type = range_difference_t<V>; *iterator*() = default; constexpr *iterator*(split_view& parent, iterator_t<V> current, subrange<iterator_t<V>> next); constexpr iterator_t<V> base() const; constexpr value_type operator*() const; constexpr *iterator*& operator++(); constexpr *iterator* operator++(int); friend constexpr bool operator==(const *iterator*& x, const *iterator*& y); };}

[ð](#lib:split_view::iterator,constructor)

`constexpr iterator(split_view& parent, iterator_t<V> current, subrange<iterator_t<V>> next);
`

[1](#1)

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

*Effects*: Initializes *parent_* with addressof(parent),*cur_* with std​::​move(current), and*next_* with std​::​move(next)[.](#1.sentence-1)

[ð](#lib:base,split_view::iterator)

`constexpr iterator_t<V> base() const;
`

[2](#2)

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

*Effects*: Equivalent to: return *cur_*;

[ð](#lib:operator*,split_view::iterator)

`constexpr value_type operator*() const;
`

[3](#3)

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

*Effects*: Equivalent to: return {*cur_*, *next_*.begin()};

[ð](#lib:operator++,split_view::iterator)

`constexpr iterator& operator++();
`

[4](#4)

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

*Effects*: Equivalent to:*cur_* = *next_*.begin();if (*cur_* != ranges::end(*parent_*->*base_*)) {*cur_* = *next_*.end(); if (*cur_* == ranges::end(*parent_*->*base_*)) {*trailing_empty_* = true; *next_* = {*cur_*, *cur_*}; } else {*next_* = *parent_*->*find-next*(*cur_*); }} else {*trailing_empty_* = false;}return *this;

[ð](#lib:operator++,split_view::iterator_)

`constexpr iterator operator++(int);
`

[5](#5)

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

*Effects*: Equivalent to:auto tmp = *this;++*this;return tmp;

[ð](#lib:operator==,split_view::iterator)

`friend constexpr bool operator==(const iterator& x, const iterator& y);
`

[6](#6)

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

*Effects*: Equivalent to:return x.*cur_* == y.*cur_* && x.*trailing_empty_* == y.*trailing_empty_*;
