std::move_iterator<Iter>::operator=

template< class U >
move_iterator& operator=( const move_iterator<U>& other );
(C++17 前)
template< class U >
constexpr move_iterator& operator=( const move_iterator<U>& other );
(C++17 起)

对底层迭代器赋 other 的底层迭代器的值,即 other.base()

U 不可转换为 Iter 则行为未定义。 (C++20 前)

此重载仅若 UIter 不是同一类型且 std::convertible_to<const U&, Iter>std::assignable_from<Iter&, const U&> 均得到实现才参与重载决议。

(C++20 起)

参数

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

返回值

*this

示例

缺陷报告

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

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

参阅

(C++11)
构造新的迭代器适配器
(公开成员函数)