名稱空間
變體
操作

operator-(ranges::transform_view::sentinel)

來自 cppreference.com
 
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
friend constexpr ranges::range_difference_t<Base>

    operator-( const /*iterator*/<Const>& x, const /*sentinel*/& y )
        requires std::sized_sentinel_for<ranges::sentinel_t<Base>,

                                         ranges::iterator_t<Base>>;
(1) (C++20 起)
friend constexpr ranges::range_difference_t<Base>

    operator-( const /*sentinel*/& y, const /*iterator*/<Const>& x )
        requires std::sized_sentinel_for<ranges::sentinel_t<Base>,

                                         ranges::iterator_t<Base>>;
(2) (C++20 起)

計算 x 的底層迭代器與 y 的底層哨兵之間的距離。

這些函式對於普通的非限定查詢限定查詢不可見,只能透過實參依賴查詢 (ADL) 找到,當 transform_view::sentinel<Const> 是實參的關聯類時。

[編輯] 引數

x - 一個迭代器
y - 一個哨兵

[編輯] 返回值

current_ 表示底層迭代器,end_ 表示底層哨兵。

1) x.current_ - y.end_
2) y.end_ - x.current_