Namespaces
Variants

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

From cppreference.net
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(C++11) (C++14)
(C++14) (C++14)
(C++11) (C++14)
(C++14) (C++14)
(C++17) (C++20)
(C++17)
(C++17)
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)
计算两个迭代器适配器间的距离
(函数模板)