[iterator.concept.sentinel]

# 24 Iterators library [[iterators]](./#iterators)

## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#iterator.concept.sentinel)

### 24.3.4 Iterator concepts [[iterator.concepts]](iterator.concepts#iterator.concept.sentinel)

#### 24.3.4.7 Concept sentinel_for [iterator.concept.sentinel]

[1](#1)

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

The [sentinel_for](#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]") concept specifies the relationship
between an [input_or_output_iterator](iterator.concept.iterator#concept:input_or_output_iterator "24.3.4.6 Concept input_­or_­output_­iterator [iterator.concept.iterator]") type and a [semiregular](concepts.object#concept:semiregular "18.6 Object concepts [concepts.object]") type
whose values denote a range[.](#1.sentence-1)

[ð](#concept:sentinel_for)

`template<class S, class I>
  concept [sentinel_for](#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]") =
    [semiregular](concepts.object#concept:semiregular "18.6 Object concepts [concepts.object]")<S> &&
    [input_or_output_iterator](iterator.concept.iterator#concept:input_or_output_iterator "24.3.4.6 Concept input_­or_­output_­iterator [iterator.concept.iterator]")<I> &&
    [weakly-equality-comparable-with](concept.equalitycomparable#concept:weakly-equality-comparable-with "18.5.4 Concept equality_­comparable [concept.equalitycomparable]")<S, I>;      // see [[concept.equalitycomparable]](concept.equalitycomparable "18.5.4 Concept equality_­comparable")
`

[2](#2)

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

Let s and i be values of type S andI such that [i, s) denotes a range[.](#2.sentence-1)

TypesS and I model [sentinel_for](#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]")<S, I> only if:

- [(2.1)](#2.1)

  i == s is well-defined[.](#2.1.sentence-1)

- [(2.2)](#2.2)

  If bool(i != s) then i is dereferenceable and
 [++i, s) denotes a range[.](#2.2.sentence-1)

- [(2.3)](#2.3)

  [assignable_from](concept.assignable#concept:assignable_from "18.4.8 Concept assignable_­from [concept.assignable]")<I&, S> is either modeled or not satisfied[.](#2.3.sentence-1)

[3](#3)

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

The domain of == is not static[.](#3.sentence-1)

Given an iterator i and sentinel s such that [i, s)
denotes a range and i != s, i and s are not required to
continue to denote a range after incrementing any other iterator equal
to i[.](#3.sentence-2)

Consequently, i == s is no longer required to be
well-defined[.](#3.sentence-3)
