std::move_iterator
From cppreference.com
Defined in header <iterator>
|
||
template< class Iterator > class move_iterator; |
(since C++11) | |
std::move_iterator
is an iterator adaptor which behaves exactly like the underlying iterator (which must be at least an InputIterator
), 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
|
Iterator
|
difference_type
|
std::iterator_traits<Iterator>::difference_type |
pointer
|
Iterator
|
value_type
|
std::iterator_traits<Iterator>::value_type |
iterator_category
|
std::iterator_traits<Iterator>::iterator_category |
reference
|
value_type&& (until C++17)
If |
Member functions
constructs a new iterator adaptor (public member function) | |
assigns another iterator (public member function) | |
accesses the underlying iterator (public member function) | |
accesses the pointed-to element (public member function) | |
accesses an element by index (public member function) | |
advances or decrements the iterator (public member function) |
Member objects
Member name | Definition |
current (private)
|
a copy of the base() iterator, the name is for exposition only |
Non-member functions
compares the underlying iterators (function template) | |
advances the iterator (function template) | |
computes the distance between two iterator adaptors (function template) |