std::move_iterator<Iter>::operator++,+,+=,--,-,-=
来自cppreference.com
< cpp | iterator | move iterator
move_iterator& operator++(); |
(1) | (C++17 起为 constexpr ) |
move_iterator& operator--(); |
(2) | (C++17 起为 constexpr ) |
(3) | ||
move_iterator operator++( int ); |
(C++17 起为 constexpr ) (C++20 前) |
|
constexpr auto operator++( int ); |
(C++20 起) | |
move_iterator operator--( int ); |
(4) | (C++17 起为 constexpr ) |
move_iterator operator+( difference_type n ) const; |
(5) | (C++17 起为 constexpr ) |
move_iterator operator-( difference_type n ) const; |
(6) | (C++17 起为 constexpr ) |
move_iterator& operator+=( difference_type n ); |
(7) | (C++17 起为 constexpr ) |
move_iterator& operator-=( difference_type n ); |
(8) | (C++17 起为 constexpr ) |
自增或自减底层迭代器。
重载 | 等价于 | ||||
---|---|---|---|---|---|
(1) | ++current ; return *this;
| ||||
(2) | --current ; return *this;
| ||||
(3) |
| ||||
(4) | move_iterator tmp = *this; --current ; return tmp;
| ||||
(5) | return move_iterator(current + n);
| ||||
(6) | return move_iterator(current - n);
| ||||
(7) | current += n; return *this;
| ||||
(8) | current -= n; return *this;
|
参数
n | - | 相对于当前位置的位置 |
返回值
如上所述。
示例
本节未完成 原因:暂无示例 |
参阅
(C++11) |
令迭代器前进 (函数模板) |
(C++11) |
计算两个迭代器适配器间的距离 (函数模板) |