std::counted_iterator< _It > Class Template Reference

Inherits std::__detail::__counted_iter_value_type< _It >, std::__detail::__counted_iter_concept< _It >, and std::__detail::__counted_iter_cat< _It >.

## Public Types

using | difference_type = iter_difference_t< _It >
using | iterator_type = _It

## Public Member Functions

constexpr | counted_iterator (_It __i, iter_difference_t< _It > __n)
template<typename _It2 >
requires constexpr convertible_to< const _It2 &, _It > | counted_iterator (const counted_iterator< _It2 > &__x)
constexpr _It | base () &&noexcept(is_nothrow_move_constructible_v< _It >)
constexpr const _It & | base () const &noexcept
constexpr iter_difference_t< _It > | count () const noexcept
constexpr decltype(auto) | operator* () const noexcept(noexcept(*_M_current)) requires __detail
constexpr decltype(auto) | operator* () noexcept(noexcept(*_M_current))
constexpr counted_iterator | operator+ (iter_difference_t< _It > __n) const requires random_access_iterator< _It >
constexpr decltype(auto) | operator++ (int)
constexpr counted_iterator | operator++ (int) requires forward_iterator< _It >
constexpr counted_iterator & | operator+= (iter_difference_t< _It > __n) requires random_access_iterator< _It >
constexpr counted_iterator | operator- (iter_difference_t< _It > __n) const requires random_access_iterator< _It >
constexpr counted_iterator & | operator-- () requires bidirectional_iterator< _It >
constexpr counted_iterator | operator-- (int) requires bidirectional_iterator< _It >
constexpr counted_iterator & | operator-= (iter_difference_t< _It > __n) requires random_access_iterator< _It >
template<typename _It2 >
requires constexpr assignable_from< _It &, const _It2 & > counted_iterator & | operator= (const counted_iterator< _It2 > &__x)
constexpr decltype(auto) | operator[] (iter_difference_t< _It > __n) const noexcept(noexcept(_M_current[__n])) requires random_access_iterator< _It >

## Friends

constexpr friend iter_rvalue_reference_t< _It > | iter_move (const counted_iterator &__i) noexcept(noexcept(ranges::iter_move(__i._M_current))) requires input_iterator< _It >
template<indirectly_swappable< _It > _It2>
constexpr friend void | iter_swap (const counted_iterator &__x, const counted_iterator< _It2 > &__y) noexcept(noexcept(ranges::iter_swap(__x._M_current, __y._M_current)))
constexpr friend counted_iterator | operator+ (iter_difference_t< _It > __n, const counted_iterator &__x) requires random_access_iterator< _It >
template<common_with< _It > _It2>
constexpr friend iter_difference_t< _It2 > | operator- (const counted_iterator &__x, const counted_iterator< _It2 > &__y)
constexpr friend iter_difference_t< _It > | operator- (const counted_iterator &__x, default_sentinel_t)
constexpr friend iter_difference_t< _It > | operator- (default_sentinel_t, const counted_iterator &__y)
template<common_with< _It > _It2>
constexpr friend strong_ordering | operator<=> (const counted_iterator &__x, const counted_iterator< _It2 > &__y)
template<common_with< _It > _It2>
constexpr friend bool | operator== (const counted_iterator &__x, const counted_iterator< _It2 > &__y)
constexpr friend bool | operator== (const counted_iterator &__x, default_sentinel_t)

## Detailed Description

### template<input_or_output_iterator _It>
class std::counted_iterator< _It >

An iterator adaptor that keeps track of the distance to the end.

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

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

- bits/stl_iterator.h