libstdc++: std::move_iterator< _Iterator > Class Template Reference

libstdc++

std::move_iterator< _Iterator > Class Template Reference
Iterators

`#include <stl_iterator.h>`

## Public Types
using | difference_type
using | iterator_concept
using | iterator_type
using | pointer
using | reference
using | value_type

## Public Member Functions
template<typename _Iter>
constexpr | move_iterator (const move_iterator< _Iter > &__i)
constexpr | move_iterator (iterator_type __i)
constexpr iterator_type | base () &&
constexpr const iterator_type & | base () const &noexcept
constexpr reference | operator* () const
constexpr move_iterator | operator+ (difference_type __n) const
constexpr move_iterator & | operator++ ()
constexpr void | operator++ (int)
constexpr move_iterator | operator++ (int)
constexpr move_iterator & | operator+= (difference_type __n)
constexpr move_iterator | operator- (difference_type __n) const
constexpr move_iterator & | operator-- ()
constexpr move_iterator | operator-- (int)
constexpr move_iterator & | operator-= (difference_type __n)
constexpr pointer | operator-> () const
template<typename _Iter>
constexpr move_iterator & | operator= (const move_iterator< _Iter > &__i)
constexpr reference | operator[] (difference_type __n) const

## Friends
constexpr iter_rvalue_reference_t< _Iterator > | iter_move (const move_iterator &__i) noexcept(noexcept(ranges::iter_move(__i._M_current)))
template<indirectly_swappable< _Iterator > _Iter2>
constexpr void | iter_swap (const move_iterator &__x, const move_iterator< _Iter2 > &__y) noexcept(noexcept(ranges::iter_swap(__x._M_current, __y._M_current)))
template<sized_sentinel_for< _Iterator > _Sent>
constexpr iter_difference_t< _Iterator > | operator- (const move_iterator &__x, const move_sentinel< _Sent > &__y)
template<sized_sentinel_for< _Iterator > _Sent>
constexpr iter_difference_t< _Iterator > | operator- (const move_sentinel< _Sent > &__x, const move_iterator &__y)
template<sentinel_for< _Iterator > _Sent>
constexpr bool | operator== (const move_iterator &__x, const move_sentinel< _Sent > &__y)

## Detailed Description

template<typename _Iterator>
class std::move_iterator< _Iterator >

An iterator adaptor that yields an rvalue reference.

Class template move_iterator is an iterator adapter with the same behavior as the underlying iterator except that its dereference operator implicitly converts the value returned by the underlying iterator's dereference operator to an rvalue reference. Some generic algorithms can be called with move iterators to replace copying with moving.

Definition at line 1448 of file bits/stl_iterator.h.

## Member Typedef Documentation

## ◆ difference_type

template<typename _Iterator>

using std::move_iterator< _Iterator >::difference_type

Definition at line 1494 of file bits/stl_iterator.h.

## ◆ iterator_concept

template<typename _Iterator>

using std::move_iterator< _Iterator >::iterator_concept

Definition at line 1490 of file bits/stl_iterator.h.

## ◆ iterator_type

template<typename _Iterator>

using std::move_iterator< _Iterator >::iterator_type

Definition at line 1487 of file bits/stl_iterator.h.

## ◆ pointer

template<typename _Iterator>

using std::move_iterator< _Iterator >::pointer

Definition at line 1495 of file bits/stl_iterator.h.

## ◆ reference

template<typename _Iterator>

using std::move_iterator< _Iterator >::reference

Definition at line 1496 of file bits/stl_iterator.h.

## ◆ value_type

template<typename _Iterator>

using std::move_iterator< _Iterator >::value_type

Definition at line 1493 of file bits/stl_iterator.h.

## Constructor & Destructor Documentation

## ◆ move_iterator() [1/3]

template<typename _Iterator>

std::move_iterator< _Iterator >::move_iterator | ( |  | ) |
| inlineconstexpr

Definition at line 1512 of file bits/stl_iterator.h.

## ◆ move_iterator() [2/3]

template<typename _Iterator>

std::move_iterator< _Iterator >::move_iterator | ( | iterator_type | __i | ) |
| inlineexplicitconstexpr

Definition at line 1516 of file bits/stl_iterator.h.

## ◆ move_iterator() [3/3]

template<typename _Iterator>
template<typename _Iter>

std::move_iterator< _Iterator >::move_iterator | ( | const move_iterator< _Iter > & | __i | ) |
| inlineconstexpr

Definition at line 1524 of file bits/stl_iterator.h.

## Member Function Documentation

## ◆ base() [1/2]

template<typename _Iterator>

iterator_type std::move_iterator< _Iterator >::base | ( |  | ) | &&
| inlinenodiscardconstexpr

Definition at line 1552 of file bits/stl_iterator.h.

## ◆ base() [2/2]

template<typename _Iterator>

const iterator_type & std::move_iterator< _Iterator >::base | ( |  | ) | const &
| inlinenodiscardconstexprnoexcept

Definition at line 1547 of file bits/stl_iterator.h.

## ◆ operator*()

template<typename _Iterator>

reference std::move_iterator< _Iterator >::operator* | ( |  | ) | const
| inlineconstexpr

Definition at line 1558 of file bits/stl_iterator.h.

## ◆ operator+()

template<typename _Iterator>

move_iterator std::move_iterator< _Iterator >::operator+ | ( | difference_type | __n | ) | const
| inlineconstexpr

Definition at line 1608 of file bits/stl_iterator.h.

## ◆ operator++() [1/3]

template<typename _Iterator>

move_iterator & std::move_iterator< _Iterator >::operator++ | ( |  | ) |
| inlineconstexpr

Definition at line 1571 of file bits/stl_iterator.h.

## ◆ operator++() [2/3]

template<typename _Iterator>

void std::move_iterator< _Iterator >::operator++ | ( | int |  | ) |
| inlineconstexpr

Definition at line 1587 of file bits/stl_iterator.h.

## ◆ operator++() [3/3]

template<typename _Iterator>

move_iterator std::move_iterator< _Iterator >::operator++ | ( | int |  | ) |
| inlineconstexpr

Definition at line 1578 of file bits/stl_iterator.h.

## ◆ operator+=()

template<typename _Iterator>

move_iterator & std::move_iterator< _Iterator >::operator+= | ( | difference_type | __n | ) |
| inlineconstexpr

Definition at line 1612 of file bits/stl_iterator.h.

## ◆ operator-()

template<typename _Iterator>

move_iterator std::move_iterator< _Iterator >::operator- | ( | difference_type | __n | ) | const
| inlineconstexpr

Definition at line 1620 of file bits/stl_iterator.h.

## ◆ operator--() [1/2]

template<typename _Iterator>

move_iterator & std::move_iterator< _Iterator >::operator-- | ( |  | ) |
| inlineconstexpr

Definition at line 1592 of file bits/stl_iterator.h.

## ◆ operator--() [2/2]

template<typename _Iterator>

move_iterator std::move_iterator< _Iterator >::operator-- | ( | int |  | ) |
| inlineconstexpr

Definition at line 1599 of file bits/stl_iterator.h.

## ◆ operator-=()

template<typename _Iterator>

move_iterator & std::move_iterator< _Iterator >::operator-= | ( | difference_type | __n | ) |
| inlineconstexpr

Definition at line 1624 of file bits/stl_iterator.h.

## ◆ operator->()

template<typename _Iterator>

pointer std::move_iterator< _Iterator >::operator-> | ( |  | ) | const
| inlineconstexpr

Definition at line 1567 of file bits/stl_iterator.h.

## ◆ operator=()

template<typename _Iterator>
template<typename _Iter>

move_iterator & std::move_iterator< _Iterator >::operator= | ( | const move_iterator< _Iter > & | __i | ) |
| inlineconstexpr

Definition at line 1533 of file bits/stl_iterator.h.

## ◆ operator[]()

template<typename _Iterator>

reference std::move_iterator< _Iterator >::operator[] | ( | difference_type | __n | ) | const
| inlineconstexpr

Definition at line 1632 of file bits/stl_iterator.h.

## Friends And Related Symbol Documentation

## ◆ move_iterator

template<typename _Iterator>
template<typename _Iter2>

friend class move_iterator
| friend

Definition at line 1461 of file bits/stl_iterator.h.

## ◆ iter_move

template<typename _Iterator>

iter_rvalue_reference_t< _Iterator > iter_move | ( | const move_iterator< _Iterator > & | __i | ) |
| friend

Definition at line 1660 of file bits/stl_iterator.h.

## ◆ iter_swap

template<typename _Iterator>
template<indirectly_swappable< _Iterator > _Iter2>

void iter_swap | ( | const move_iterator< _Iterator > & | __x,
|  | const move_iterator< _Iter2 > & | __y )
| friend

Definition at line 1666 of file bits/stl_iterator.h.

## ◆ operator- [1/2]

template<typename _Iterator>
template<sized_sentinel_for< _Iterator > _Sent>

iter_difference_t< _Iterator > operator- | ( | const move_iterator< _Iterator > & | __x,
|  | const move_sentinel< _Sent > & | __y )
| friend

Definition at line 1655 of file bits/stl_iterator.h.

## ◆ operator- [2/2]

template<typename _Iterator>
template<sized_sentinel_for< _Iterator > _Sent>

iter_difference_t< _Iterator > operator- | ( | const move_sentinel< _Sent > & | __x,
|  | const move_iterator< _Iterator > & | __y )
| friend

Definition at line 1649 of file bits/stl_iterator.h.

## ◆ operator==

template<typename _Iterator>
template<sentinel_for< _Iterator > _Sent>

bool operator== | ( | const move_iterator< _Iterator > & | __x,
|  | const move_sentinel< _Sent > & | __y )
| friend

Definition at line 1643 of file bits/stl_iterator.h.

The documentation for this class was generated from the following file:

- bits/stl_iterator.h