std::ranges::slide_view<V>::iterator<Const>::operator++,--,+=,-=
来自cppreference.com
| |
(1) | (C++23 起) |
| |
(2) | (C++23 起) |
| |
(3) | (C++23 起) |
| |
(4) | (C++23 起) |
| |
(5) | (C++23 起) |
| |
(6) | (C++23 起) |
推进或减小迭代器 iterator。
令 current_ 与 last_ele_ 为指向滑窗首部与尾部的底层迭代器。
1) 等价于:
调用前,
current_ = ranges::next(current_);
last_ele_ = ranges::next(last_ele_); // 若 last_ele_ 存在
return *this;
current_ 与 last_ele_(若存在)必须是可自增的。2) 等价于:
auto tmp = *this; ++*this; return tmp;3) 等价于:
调用前,
current_ = ranges::prev(current_);
last_ele_ = ranges::prev(last_ele_); // 若 last_ele_ 存在
return *this;
current_ 与 last_ele_(若存在)必须是可自增的。4) 等价于:
auto tmp = *this; --*this; return tmp;5) 等价于:
调用前,表达式
current_ = current_ + n;
last_ele_ = last_ele_ + n; // 若 last_ele_ 存在
return *this;
current_ + n 与 last_ele_ + n(如果 last_ele_ 存在)的行为必须良定义。6) 等价于:
调用前,表达式
current_ = current_ - n;
last_ele_ = last_ele_ - n; // 若 last_ele_ 存在
return *this;
current_ - n 与 last_ele_ - n(如果 last_ele_ 存在)的行为必须良定义。参数
| n | - | 相对于当前位置的位移 |
返回值
1,3,5,6)
*this2,4)
*this 被修改前的副本示例
| 本节未完成 原因:暂无示例 |
参阅
(C++23) |
进行迭代器算术 (函数) |