std::move_iterator (3) - Linux Manuals
std::move_iterator: std::move_iterator
NAME
std::move_iterator - std::move_iterator
Synopsis
Defined in header <iterator>
template< class Iter > (since C++11)
class move_iterator;
std::move_iterator is an iterator adaptor which behaves exactly like the underlying iterator (which must be at least an LegacyInputIterator), except that dereferencing converts the value returned by the underlying iterator into an rvalue. If this iterator is used as an input iterator, the effect is that the values are moved from, rather than copied from.
Member types
Member type Definition
iterator_type Iter
difference_type std::iterator_traits<Iter>::difference_type
pointer Iter
value_type std::iterator_traits<Iter>::value_type
iterator_category std::iterator_traits<Iter>::iterator_category
reference value_type&& (until C++17)
Member functions
constructor (public member function)
operator= (public member function)
base (public member function)
operator*
operator-> accesses the pointed-to element
(deprecated in C++20)
operator[] (public member function)
operator++
operator++(int)
operator+= advances or decrements the iterator
operator+ (public member function)
operator--
operator--(int)
operator-=
operator-
Member objects
Member name Definition
current (private) a copy of the base() iterator, the name is for exposition only
Non-member functions
operator==
operator!= compares the underlying iterators
operator< (function template)
operator<=
operator>
operator>=
operator+ (function template)
operator- (function template)
Example
// Run this code