std::ranges::enumerate_view<V>::iterator<Const>::operator++,--,+=,-=
來自 cppreference.com
< cpp | ranges | enumerate view | iterator
constexpr /*迭代器*/& operator++(); |
(1) | (C++23 起) |
constexpr void operator++( int ); |
(2) | (C++23 起) |
constexpr /*iterator*/ operator++( int ) requires ranges::forward_range<Base>; |
(3) | (C++23 起) |
constexpr /*iterator*/& operator--() requires ranges::bidirectional_range<Base>; |
(4) | (C++23 起) |
constexpr /*iterator*/ operator--( int ) requires ranges::bidirectional_range<Base>; |
(5) | (C++23 起) |
constexpr /*iterator*/& operator+=( difference_type n ) requires ranges::random_access_range<Base>; |
(6) | (C++23 起) |
constexpr /*iterator*/& operator-=( difference_type n ) requires ranges::random_access_range<Base>; |
(7) | (C++23 起) |
遞增或遞減迭代器。
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) *this
2) (無)
3,5) 改變之前 *this 的一個副本
[編輯] 參閱
(C++23) |
進行迭代器算術 (函式) |