std::move_iterator<Iter>::move_iterator
来自cppreference.com
< cpp | iterator | move iterator
| (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) |
赋值另一迭代器适配器 (公开成员函数) |
| (C++11) |
创建拥有从实参推出的类型的 std::move_iterator (函数模板) |