Namespaces
Variants

std::move_iterator<Iter>:: operator=

From cppreference.net
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(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 > false ,且同时满足 std:: convertible_to < const U & , Iter > std:: assignable_from < Iter & , const U & > 概念时,此重载才参与重载决议。

(C++20 起)

目录

参数

其他 - 用于赋值的迭代器适配器

返回值

* this

示例

缺陷报告

以下行为变更缺陷报告被追溯应用于先前发布的C++标准。

缺陷报告 适用范围 发布时行为 正确行为
LWG 3435 C++20 转换赋值运算符未受约束 已受约束

参见

构造新的 move_iterator
(公开成员函数)