operator+(std::move_iterator)
来自 zh.cppreference.net
| 定义于头文件 <iterator>
|
||
template< class Iter >
move_iterator<Iter> operator+
( typename move_iterator<Iter>::difference_type n,
const move_iterator<Iter>& it );
|
(自 C++11 起) (自 C++17 起 constexpr) (C++20 前) |
|
template< class Iter >
constexpr move_iterator<Iter> operator+
( std::iter_difference_t<Iter> n, const move_iterator<Iter>& it );
|
(自 C++20 起) | |
返回迭代器 it 增加 n 后的结果。
|
此重载仅在 |
(自 C++20 起) |
参数
| n | - | 要递增迭代器的位置数量 |
| it | - | 要递增的迭代器适配器 |
返回值
it + n
示例
|
本节内容不完整
原因:缺少示例 |
缺陷报告
以下行为变更缺陷报告被追溯应用于先前发布的C++标准。
| 缺陷报告 | 应用于 | 发布时的行为 | 正确行为 |
|---|---|---|---|
| LWG 3293 | C++20 |
非成员
operator
+
被约束为
要求 it + n 格式正确且具有类型
Iter
|
更改为
it. base ( ) + n |
参见
前进或后退
move_iterator
(公开成员函数) |
|
|
(C++11)
|
计算两个迭代器适配器间的距离
(函数模板) |