名稱空間
變體
操作

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

來自 cppreference.com
< cpp‎ | ranges‎ | zip_view‎ | sentinel
 
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
template< bool OtherConst >

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

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

x 的底層迭代器元組與 y 的底層哨兵元組進行比較。

此函式對於常規的非限定限定查詢不可見,只能透過實參依賴查詢找到,當 zip_view::sentinel<Const> 是實參的關聯類時。

!= 運算子由 operator== 合成

[編輯] 引數

x - 待比較的迭代器
y - 待比較的哨兵

[編輯] 返回值

x.current_ 表示底層迭代器元組,y.end_ 表示底層哨兵元組。

返回

  • 如果至少有一個底層迭代器(透過類似於 std::get<i>(x.current_) 的表示式獲得)與某個底層哨兵(透過類似於 std::get<i>(y.end_) 的表示式獲得)相等(使用適當的 operator==),對於範圍 0 <= i < sizeof...(Views) 中的某個索引 i,則返回 true
  • 否則返回 false

[編輯] 示例