std::move_iterator<Iter>::move_iterator
来自cppreference.com
< cpp | iterator | move iterator
迭代器库
| 迭代器概念 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 迭代器原语 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 算法概念与工具 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 间接可调用概念 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 常用算法要求 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 工具 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 迭代器适配器 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 流迭代器 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 迭代器定制点 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(C++20)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(C++20)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 迭代器操作 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 范围访问 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::move_iterator
| 成员函数 | ||||
|
move_iterator::move_iterator
|
||||
| 非成员函数 | ||||
|
(C++20)
|
||||
|
(C++20)
|
||||
|
(C++20)
|
||||
|
(C++20)
|
| (1) | ||
|
move_iterator();
|
(C++17 前) | |
|
constexpr
move_iterator();
|
(C++17 起) | |
| (2) | ||
|
explicit
move_iterator(
iterator_type x );
|
(C++17 前) | |
|
constexpr
explicit
move_iterator(
iterator_type x );
|
(C++17 起) | |
| (3) | ||
|
template<
class U
>
move_iterator( const move_iterator<U>& other ); |
(C++17 前) | |
|
template<
class U
>
constexpr move_iterator( const move_iterator<U>& other ); |
(C++17 起) | |
构造新的迭代器适配器。
1)
默认构造函数。值初始化底层迭代器。当且仅当值初始化的底层迭代器有受定义行为时,产生的迭代器上的操作才一样有受定义行为。
2) 以 x
(C++20
前)std::move(x)
(C++20
起) 初始化底层迭代器。
3) 以 other
的底层迭代器初始化底层迭代器。如果
U 不可转换成 Iter 那么行为未定义
(C++20
前)此重载只有在 U 与
Iter 不是同一类型且 std::convertible_to<const U&,
Iter>
得到实现时才会参与重载决议 (C++20
起)。参数
| x | - | 要适配的迭代器 |
| other | - | 要复制的迭代器适配器 |
示例
| 本节未完成 原因:暂无示例 |
缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
| 缺陷报告 | 应用于 | 出版时的行为 | 正确行为 |
|---|---|---|---|
| LWG 3435 | C++20 | 源自另一 move_iterator 的转换构造函数未受约束
|
已约束 |
参阅
|
(C++11)
|
赋值另一迭代器适配器 (公开成员函数) |