(1) | ||
move_iterator(); | (until C++17) | |
constexpr move_iterator(); | (since C++17) | |
(2) | ||
explicit move_iterator( iterator_type x ); | (until C++17) | |
constexpr explicit move_iterator( iterator_type x ); | (since C++17) | |
(3) | ||
template< class U > move_iterator( const move_iterator<U>& other ); | (until C++17) | |
template< class U > constexpr move_iterator( const move_iterator<U>& other ); | (since C++17) |
Constructs a new iterator adaptor.
Iter
also have defined behavior.x
(until C++20)std::move(x)
(since C++20).other
. The behavior is undefined if U
is not convertible to Iter
(until C++20)This overload participates in overload resolution only if U
is not the same type as Iter
and std::convertible_to<const U&, Iter>
is modeled (since C++20).x | - | iterator to adapt |
other | - | iterator adaptor to copy |
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 | the converting constructor from another move_iterator was not constrained | constrained |
(C++11) | assigns another iterator adaptor (public member function) |
(C++11) | creates a std::move_iterator of type inferred from the argument (function template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/iterator/move_iterator/move_iterator