Namespaces
Variants
Views
Actions

std::reverse_iterator<Iter>::operator=

From cppreference.com
 
 
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
Utilities
Iterator adaptors
Stream iterators
Iterator customization points
Iterator operations
(C++11)
(C++11)
Range access
(C++11)(C++14)
(C++11)(C++14)
(C++17)(C++20)
(C++14)(C++14)
(C++14)(C++14)
(C++17)
(C++17)
 
 
template< class U >
reverse_iterator& operator=( const reverse_iterator<U>& other );
(until C++17)
template< class U >
constexpr reverse_iterator& operator=( const reverse_iterator<U>& other );
(since C++17)

The underlying iterator is assigned the value of the underlying iterator of other, i.e. other.base().

This overload only participates in overload resolution if U is not the same type as Iter and std::convertible_to<const U&, Iter> and std::assignable_from<Iter&, const U&> are modeled.

(since C++20)

Contents

[edit] Parameters

other - iterator adaptor to assign

[edit] Return value

*this

[edit] Example

[edit] 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 the converting assignment operator was not constrained constrained

[edit] See also

constructs a new iterator adaptor
(public member function) [edit]