[range.lazy.split.inner]

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

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.lazy.split.inner)

### 25.7.16 Lazy split view [[range.lazy.split]](range.lazy.split#inner)

#### 25.7.16.5 Class template lazy_split_view​::​*inner-iterator* [range.lazy.split.inner]

[ð](#lib:lazy_split_view::inner-iterator)

namespace std::ranges {template<[input_range](range.refinements#concept:input_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> &&([forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<V> || [*tiny-range*](range.lazy.split.view#concept:tiny-range "25.7.16.2 Class template lazy_­split_­view [range.lazy.split.view]")<Pattern>)template<bool Const>struct lazy_split_view<V, Pattern>::*inner-iterator* {private:using *Base* = *maybe-const*<Const, V>; // *exposition only**outer-iterator*<Const> *i_* = *outer-iterator*<Const>(); // *exposition only*bool *incremented_* = false; // *exposition only*public:using iterator_concept = typename *outer-iterator*<Const>::iterator_concept; using iterator_category = *see below*; // present only if *Base*// models [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")using value_type = range_value_t<*Base*>; using difference_type = range_difference_t<*Base*>; *inner-iterator*() = default; constexpr explicit *inner-iterator*(*outer-iterator*<Const> i); constexpr const iterator_t<*Base*>& base() const & noexcept; constexpr iterator_t<*Base*> base() && requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<V>; constexpr decltype(auto) operator*() const { return **i_*.*current*; }constexpr *inner-iterator*& operator++(); constexpr decltype(auto) operator++(int) {if constexpr ([forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>) {auto tmp = *this; ++*this; return tmp; } else++*this; }friend constexpr bool operator==(const *inner-iterator*& x, const *inner-iterator*& y)requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; friend constexpr bool operator==(const *inner-iterator*& x, default_sentinel_t); friend constexpr decltype(auto) iter_move(const *inner-iterator*& i)noexcept(noexcept(ranges::iter_move(i.*i_*.*current*))) {return ranges::iter_move(i.*i_*.*current*); }friend constexpr void iter_swap(const *inner-iterator*& x, const *inner-iterator*& y)noexcept(noexcept(ranges::iter_swap(x.*i_*.*current*, y.*i_*.*current*)))requires [indirectly_swappable](alg.req.ind.swap#concept:indirectly_swappable "24.3.7.4 Concept indirectly_­swappable [alg.req.ind.swap]")<iterator_t<*Base*>>; };}

[1](#1)

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

If *Base* does not model [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]") there is no member iterator_category[.](#1.sentence-1)

Otherwise, the [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4 The typedef specifier [dcl.typedef]") iterator_category denotes:

- [(1.1)](#1.1)

forward_iterator_tag ifiterator_traits<iterator_t<*Base*>>​::​iterator_category models[derived_from](concept.derived#concept:derived_from "18.4.3 Concept derived_­from [concept.derived]")<forward_iterator_tag>;

- [(1.2)](#1.2)

otherwise, iterator_traits<iterator_t<*Base*>>​::​iterator_category[.](#1.sentence-2)

[ð](#lib:lazy_split_view::inner-iterator,constructor)

`constexpr explicit inner-iterator(outer-iterator<Const> i);
`

[2](#2)

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

*Effects*: Initializes *i_* with std​::​move(i)[.](#2.sentence-1)

[ð](#lib:base,lazy_split_view::inner-iterator)

`constexpr const iterator_t<Base>& base() const & noexcept;
`

[3](#3)

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

*Effects*: Equivalent to: return *i_*.*current*;

[ð](#lib:base,lazy_split_view::inner-iterator_)

`constexpr iterator_t<Base> base() && requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<V>;
`

[4](#4)

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

*Effects*: Equivalent to: return std​::​move(*i_*.*current*);

[ð](#lib:operator++,lazy_split_view::inner-iterator)

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

[5](#5)

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

*Effects*: Equivalent to:*incremented_* = true;if constexpr (![forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>) {if constexpr (Pattern::size() == 0) {return *this; }}++*i_*.*current*;return *this;

[ð](#lib:operator==,lazy_split_view::inner-iterator)

`friend constexpr bool operator==(const inner-iterator& x, const inner-iterator& y)
  requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[6](#6)

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

*Effects*: Equivalent to: return x.*i_*.*current* == y.*i_*.*current*;

[ð](#lib:operator==,lazy_split_view::inner-iterator_)

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

[7](#7)

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

*Effects*: Equivalent to:auto [pcur, pend] = subrange{x.*i_*.*parent_*->*pattern_*};auto end = ranges::end(x.*i_*.*parent_*->*base_*);if constexpr ([*tiny-range*](range.lazy.split.view#concept:tiny-range "25.7.16.2 Class template lazy_­split_­view [range.lazy.split.view]")<Pattern>) {const auto & cur = x.*i_*.*current*; if (cur == end) return true; if (pcur == pend) return x.*incremented_*; return *cur == *pcur;} else {auto cur = x.*i_*.*current*; if (cur == end) return true; if (pcur == pend) return x.*incremented_*; do {if (*cur != *pcur) return false; if (++pcur == pend) return true; } while (++cur != end); return false;}

[ð](#lib:iter_swap,lazy_split_view::inner-iterator)

`friend constexpr void iter_swap(const inner-iterator& x, const inner-iterator& y)
  noexcept(noexcept(ranges::iter_swap(x.i_.current, y.i_.current)))
  requires [indirectly_swappable](alg.req.ind.swap#concept:indirectly_swappable "24.3.7.4 Concept indirectly_­swappable [alg.req.ind.swap]")<iterator_t<Base>>;
`

[8](#8)

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

*Effects*: Equivalent toranges​::​iter_swap(x.*i_*.*current*, y.*i_*.*current*)[.](#8.sentence-1)
