operator-(ranges::adjacent_view::sentinel)
來自 cppreference.com
< cpp | ranges | adjacent view | sentinel
template< bool OtherConst > requires std::sized_sentinel_for<ranges::sentinel_t<Base>, |
(1) | (C++23 起) |
template< bool OtherConst > requires std::sized_sentinel_for<ranges::sentinel_t<Base>, |
(2) | (C++23 起) |
計算 x 的底層迭代器與 y 的底層哨兵之間的距離。
設 current_
表示 x 中迭代器的底層陣列,end_
表示 y 中底層哨兵。
1) 等價於: return x.current_.back() - y.end_;
2) 等價於: return y.end_ - x.current_.back();
這些函式模板對普通的非限定或限定查詢不可見,只有當 adjacent_view::sentinel
是實參的關聯類時,才能透過實參依賴查詢找到它們。
目錄 |
[編輯] 引數
x | - | 一個 迭代器 |
y | - | 一個 哨兵 |
[編輯] 返回值
x 和 y 之間的距離。
[編輯] 示例
本節不完整 原因:無示例 |