std::ranges::enumerate_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 起) |
| |
(7) | (C++23 起) |
推进或回退迭代器。
令 current_ 表示底层迭代器并令 pos_ 表示底层索引。
1) 等价于
++current_; ++pos_; return *this;2) 等价于
++current_;3) 等价于
auto tmp = *this; ++*this; return tmp;4) 等价于
--current_; --pos_; return *this;5) 等价于
auto tmp = *this; --*this; return tmp;6) 等价于
current_ += n; pos_ += n; return *this;7) 等价于
current_ -= n; pos_ -= n; return *this;参数
| n | - | 相对于当前位置的偏移 |
返回值
1,4,6,7)
*this2) (无)
3,5)
*this 被改变之前的副本参阅
(C++23) |
实行迭代器算术运算 (函数) |