std::move_iterator<Iter>::operator=

来自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)
 
 
template< class U >
move_iterator& operator=( const move_iterator<U>& other );
(C++17 起为 constexpr)

other.current 赋给 current 。

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

(C++20 前)

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

(C++20 起)

目录

[编辑] 参数

other - 要赋值的迭代器适配器

[编辑] 返回值

*this

[编辑] 示例

[编辑] 缺陷报告

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

缺陷报告 应用于 出版时的行为 正确行为
LWG 3435 C++20 转换赋值运算符未受约束 已约束

[编辑] 参阅

构造新的 move_iterator
(公开成员函数) [编辑]