Namespaces
Variants

std::experimental::ranges:: Sentinel

From cppreference.net
template < class S, class I >

concept bool Sentinel =
Semiregular < S > && Iterator < I > &&

WeaklyEqualityComparableWith < S, I > ;
(ranges TS)

Sentinel 概念规定了 Iterator 类型与 Semiregular 类型之间的关系,后者的值用于表示一个范围。

s i 分别为类型 S I 的值,使得 [ i , s ) 表示一个范围。仅当满足以下条件时, Sentinel<S, I> 才成立:

  • i == s 是明确定义的。
  • bool ( i ! = s ) 成立,则 i 是可解引用的,且 [ ++ i , s ) 表示一个范围。

== 的定义域可能随时间变化。给定迭代器 i 与哨位 s ,若 [ i , s ) 表示一个区间且 i ! = s ,则在递增任何等于 i 的迭代器后, [ i , s ) 不再被要求继续表示有效区间(因此在此类递增操作后, i == s 不再被要求具有良定义性)。