[range.lazy.split.outer]

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

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

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

#### 25.7.16.3 Class template lazy_split_view​::​*outer-iterator* [range.lazy.split.outer]

[ð](#lib:lazy_split_view::outer-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>::*outer-iterator* {private:using *Parent* = *maybe-const*<Const, lazy_split_view>; // *exposition only*using *Base* = *maybe-const*<Const, V>; // *exposition only**Parent** *parent_* = nullptr; // *exposition only* iterator_t<*Base*> *current_* = iterator_t<*Base*>(); // *exposition only*, present only// if V models [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")bool *trailing_empty_* = false; // *exposition only*public:using iterator_concept = conditional_t<[forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>, forward_iterator_tag, input_iterator_tag>; using iterator_category = input_iterator_tag; // present only if *Base*// models [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")// [[range.lazy.split.outer.value]](range.lazy.split.outer.value "25.7.16.4 Class lazy_­split_­view​::​outer-iterator​::​value_­type"), class lazy_split_view​::​*outer-iterator*​::​value_typestruct value_type; using difference_type = range_difference_t<*Base*>; *outer-iterator*() = default; constexpr explicit *outer-iterator*(*Parent*& parent)requires (![forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>); constexpr *outer-iterator*(*Parent*& parent, iterator_t<*Base*> current)requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; constexpr *outer-iterator*(*outer-iterator*<!Const> i)requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<iterator_t<V>, iterator_t<*Base*>>; constexpr value_type operator*() const; constexpr *outer-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 *outer-iterator*& x, const *outer-iterator*& y)requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<*Base*>; friend constexpr bool operator==(const *outer-iterator*& x, default_sentinel_t); };}

[1](#1)

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

Many of the specifications in [[range.lazy.split]](range.lazy.split "25.7.16 Lazy split view") refer to the notional member*current* of *outer-iterator*[.](#1.sentence-1)

*current* is equivalent to *current_* if V models [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]"), and **parent_*->*current_* otherwise[.](#1.sentence-2)

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

`constexpr explicit outer-iterator(Parent& parent)
  requires (![forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<Base>);
`

[2](#2)

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

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

[ð](#lib:lazy_split_view::outer-iterator,constructor_)

`constexpr outer-iterator(Parent& parent, iterator_t<Base> current)
  requires [forward_range](range.refinements#concept:forward_range "25.4.6 Other range refinements [range.refinements]")<Base>;
`

[3](#3)

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

*Effects*: Initializes *parent_* with addressof(parent) and *current_* with std​::​move(current)[.](#3.sentence-1)

[ð](#lib:lazy_split_view::outer-iterator,constructor__)

`constexpr outer-iterator(outer-iterator<!Const> i)
  requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<iterator_t<V>, iterator_t<Base>>;
`

[4](#4)

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

*Effects*: Initializes *parent_* with i.*parent_*,*current_* with std​::​move(i.*current_*), and*trailing_empty_* with i.*trailing_empty_*[.](#4.sentence-1)

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

`constexpr value_type operator*() const;
`

[5](#5)

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

*Effects*: Equivalent to: return value_type{*this};

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

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

[6](#6)

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

*Effects*: Equivalent to:const auto end = ranges::end(*parent_*->*base_*);if (*current* == end) {*trailing_empty_* = false; return *this;}const auto [pbegin, pend] = subrange{*parent_*->*pattern_*};if (pbegin == pend) ++*current*;else 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>) {*current* = ranges::find(std::move(*current*), end, *pbegin); if (*current* != end) {++*current*; if (*current* == end)*trailing_empty_* = true; }}else {do {auto [b, p] = ranges::mismatch(*current*, end, pbegin, pend); if (p == pend) {*current* = b; if (*current* == end)*trailing_empty_* = true; break; // The pattern matched; skip it}} while (++*current* != end);}return *this;

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

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

[7](#7)

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

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

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

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

[8](#8)

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

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