命名空间
变体
操作

operator==(ranges::adjacent_view::iterator, ranges::adjacent_view::sentinel)

来自 cppreference.cn
< cpp‎ | ranges‎ | adjacent view‎ | sentinel
 
 
范围库 (Ranges library)
范围适配器 (Range adaptors)
 
 
template< bool OtherConst >

    requires std::sentinel_for<ranges::sentinel_t<Base>,
                               ranges::iterator_t</*maybe-const*/<OtherConst, V>>>
friend constexpr bool operator==( const /*iterator*/<OtherConst>& x,

                                  const /*sentinel*/& y );
(C++23 起)

比较 x 的底层迭代器与 y 的底层哨位。

等价于:return x.current_.back() == y.end_,其中 current_x 中的底层迭代器数组,而 end_y 中的底层哨位。

此函数对通常的无限定限定查找不可见,只能在 adjacent_view::sentinel<Const> 是参数的关联类时由实参依赖查找找到。

!= 运算符由 operator== 合成

[编辑] 参数

x - 要比较的迭代器
y - 要比较的哨位

[编辑] 返回值

若存储在 x 中的底层迭代器是末尾迭代器,则为 true

[编辑] 示例