23 Iterators library [iterators]

23.3 Iterator requirements [iterator.requirements]

23.3.4 Iterator concepts [iterator.concepts]

23.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]

The sentinel_­for concept specifies the relationship between an input_­or_­output_­iterator type and a semiregular type whose values denote a range.
template<class S, class I> concept sentinel_­for = semiregular<S> && input_or_output_iterator<I> && weakly-equality-comparable-with<S, I>; // See [concept.equalitycomparable]
Let s and i be values of type S and I such that [i, s) denotes a range.
Types S and I model sentinel_­for<S, I> only if
  • i == s is well-defined.
  • If bool(i != s) then i is dereferenceable and [++i, s) denotes a range.
The domain of == is not static.
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.
Consequently, i == s is no longer required to be well-defined.