std::move_iterator<Iter>:: move_iterator

From cppreference.com
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)
move_iterator ( ) ;
(1) (constexpr since C++17)
explicit move_iterator ( iterator_type x ) ;
(2) (constexpr since C++17)
template < class U >
move_iterator ( const move_iterator < U > & other ) ;
(3) (constexpr since C++17)

Constructs a new move_iterator .

Overload current
(1) value-initialized
(2) initialized with x (until C++20) std :: move ( x ) (since C++20)
(3) initialized with other. current
3) The converting constructor.

If U is not convertible to Iter , the program is ill-formed.

(until C++20)

This overload participates in overload resolution only if std:: is_same_v < U, Iter > is false and std:: convertible_to < const U & , Iter > is modeled.

(since C++20)

Parameters

x - iterator to adapt
other - iterator adaptor to copy

Example

Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
LWG 3435 C++20 overload ( 3 ) was not constrained constrained

See also

(C++11)
assigns another iterator adaptor
(public member function)
creates a std::move_iterator of type inferred from the argument
(function template)