| (1) | ||
reverse_iterator(); | (until C++17) | |
constexpr reverse_iterator(); | (since C++17) | |
| (2) | ||
explicit reverse_iterator( iterator_type x ); | (until C++17) | |
constexpr explicit reverse_iterator( iterator_type x ); | (since C++17) | |
| (3) | ||
template< class U > reverse_iterator( const reverse_iterator<U>& other ); | (until C++17) | |
template< class U > constexpr reverse_iterator( const reverse_iterator<U>& other ); | (since C++17) |
Constructs a new iterator adaptor.
Iter also have defined behavior.x.other. 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 235 | C++98 | the effect of the default constructor was not specified | specified |
| LWG 1012 | C++98 | the underlying iterator was default-initialized | it is value-initialized |
| LWG 3435 | C++20 | the converting constructor from another reverse_iterator was not constrained | constrained |
| assigns another iterator adaptor (public member function) |
|
|
(C++14) | creates a std::reverse_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/reverse_iterator/reverse_iterator