std::move_iterator<Iter>::move_iterator

来自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)
 
 
move_iterator();
(1)(C++17 起为 constexpr)
explicit move_iterator( iterator_type x );
(2)(C++17 起为 constexpr)
template< class U >
move_iterator( const move_iterator<U>& other );
(3)(C++17 起为 constexpr)

构造新的 move_iterator

  重载  current
(1)值初始化
(2) 以 x(C++20 前)std::move(x)(C++20 起) 初始化 
(3)other.current 初始化
3) 转换构造函数。

如果 U 不可转换到 Iter,那么程序非良构。

(C++20 前)

此重载只有在 std::is_same_v<U, Iter>falsestd::convertible_to<const U&, Iter> 得到实现时才会参与重载决议。

(C++20 起)

参数

x-要适配的迭代器
other-要复制的迭代器适配器

示例

缺陷报告

下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。

缺陷报告应用于出版时的行为正确行为
LWG 3435C++20重载 (3) 没有被约束添加约束

参阅

赋值另一 move_iterator
(公开成员函数)
创建拥有从实参推出的类型的 std::move_iterator
(函数模板)