std::make_reverse_iterator

From cppreference.com
< cpp‎ | iterator
Defined in header <iterator>
template <class Iterator>
std::reverse_iterator<Iterator> make_reverse_iterator( Iterator i );
(since C++14)

make_reverse_iterator is a convenience function template that constructs a std::reverse_iterator for the given iterator i with the type deduced from the type of the argument.

Contents

[edit] Parameters

i - input iterator to be converted to reverse iterator

[edit] Return value

A std::reverse_iterator constructed from i

[edit] Possible implementation

template< class Iterator >
std::reverse_iterator<Iterator> make_reverse_iterator( Iterator i )
{
    return std::reverse_iterator<Iterator>(i);
}

[edit] Example

[edit] See also

iterator adaptor for reverse-order traversal
(class template)
returns a reverse iterator to a container or array
(function)
(C++14)
returns a reverse end iterator for a container or array
(function)