9 Iterators library [iterators]

9.3 Iterator requirements [iterator.requirements]

9.3.9 Concept Sentinel [iterators.sentinel]

The Sentinel concept specifies the relationship between an Iterator type and a Semiregular type whose values denote a range.

template <class S, class I> concept bool Sentinel = Semiregular<S> && Iterator<I> && WeaklyEqualityComparableWith<S, I>;

Let s and i be values of type S and I such that [i,s) denotes a range. Types S and I satisfy Sentinel<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 == can change over time. Given an iterator i and sentinel s such that [i,s) denotes a range and i != s, [i,s) is not required to continue to denote a range after incrementing any iterator equal to i. Consequently, i == s is no longer required to be well-defined.