operator-(ranges::transform_view::sentinel)
來自 cppreference.com
< cpp | ranges | transform view | sentinel
friend constexpr ranges::range_difference_t<Base> operator-( const /*iterator*/<Const>& x, const /*sentinel*/& y ) |
(1) | (C++20 起) |
friend constexpr ranges::range_difference_t<Base> operator-( const /*sentinel*/& y, const /*iterator*/<Const>& x ) |
(2) | (C++20 起) |
計算 x 的底層迭代器與 y 的底層哨兵之間的距離。
這些函式對於普通的非限定查詢或限定查詢不可見,只能透過實參依賴查詢 (ADL) 找到,當 transform_view::sentinel<Const>
是實參的關聯類時。
[編輯] 引數
x | - | 一個迭代器 |
y | - | 一個哨兵 |
[編輯] 返回值
令 current_
表示底層迭代器,end_
表示底層哨兵。
1) x.current_ - y.end_
2) y.end_ - x.current_