命名空间
变体
操作

std::ranges::enumerate_view<V>::iterator<Const>::operator++,--,+=,-=

来自 cppreference.cn
 
 
范围库 (Ranges library)
范围适配器 (Range adaptors)
 
 
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 起)

递增或递减迭代器

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) *this
2) (无)
3,5) 改变之前 *this 的一个副本

[编辑] 参阅

进行迭代器算术
(函数)