std::move_iterator<Iter>::operator++,+,+=,--,-,-=

来自cppreference.com
 
 
迭代器库
迭代器概念
迭代器原语
算法概念与工具
间接可调用概念
常用算法要求
(C++20)
(C++20)
(C++20)
工具
(C++20)
迭代器适配器
范围访问
(C++11)(C++14)
(C++14)(C++14)  
(C++11)(C++14)
(C++14)(C++14)  
(C++17)(C++20)
(C++17)
(C++17)
 
std::move_iterator
成员函数
move_iterator::operator++move_iterator::operator+move_iterator::operator+=move_iterator::operator--move_iterator::operator-move_iterator::operator-=
非成员函数
(C++20)
(C++20)
 
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)

move_iterator tmp = *this; ++current ; return tmp;

(C++20 前)
(C++20 起)
(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)
计算两个迭代器适配器间的距离
(函数模板)