Range-v3 Range algorithms, views, and actions for the Standard Library |

Classes | Typedefs | Variables
Iterator Concepts
Iterator

## Description

Iterator concepts

## Classes
struct | ranges::incrementable_traits< detail::projected_< I, Proj > >
struct | ranges::sentinel_tag
struct | ranges::sized_sentinel_tag

## Typedefs
template<typename Fun , typename... Is>
using | ranges::indirect_result_t = detail::enable_if_t<(bool) and_v<(bool) indirectly_readable< Is >... >, invoke_result_t< Fun, iter_reference_t< Is >... > >
template<typename Rng >
using | ranges::iterator_tag_of = std::enable_if_t< input_iterator< Rng >, meta::conditional_t< contiguous_iterator< Rng >, ranges::contiguous_iterator_tag, meta::conditional_t< random_access_iterator< Rng >, std::random_access_iterator_tag, meta::conditional_t< bidirectional_iterator< Rng >, std::bidirectional_iterator_tag, meta::conditional_t< forward_iterator< Rng >, std::forward_iterator_tag, std::input_iterator_tag > >> >>
template<typename I , typename Proj >
using | ranges::projected = typename detail::select_projected_< Proj >::template apply< I >
template<typename S , typename I >
using | ranges::sentinel_tag_of = std::enable_if_t< sentinel_for< S, I >, meta::conditional_t< sized_sentinel_for< S, I >, sized_sentinel_tag, sentinel_tag > >

## Variables
template<typename I >
concept | ranges::bidirectional_iterator__requires_
template<typename I >
concept | ranges::contiguous_iterator
template<typename I >
concept | ranges::contiguous_iterator__concept_ = std::is_lvalue_reference<iter_reference_t<I>>::value && same_as<iter_value_t<I>, uncvref_t<iter_reference_t<I>>> && derived_from<detail::iter_concept_t<I>, ranges::contiguous_iterator_tag>
template<typename I >
concept | ranges::forward_iterator
template<typename I >
concept | ranges::incrementable__requires_
template<typename F , typename I1 , typename I2 >
concept | ranges::indirect_binary_predicate_
template<typename F , typename I1 , typename I2 >
concept | ranges::indirect_binary_predicate_impl__concept_ = predicate<F &, iter_value_t<I1> &, iter_value_t<I2> &> && predicate<F &, iter_value_t<I1> &, iter_reference_t<I2>> && predicate<F &, iter_reference_t<I1>, iter_value_t<I2> &> && predicate<F &, iter_reference_t<I1>, iter_reference_t<I2>> && predicate<F &, iter_common_reference_t<I1>, iter_common_reference_t<I2>>
template<typename F , typename I1 , typename I2 = I1>
concept | ranges::indirect_relation
template<typename F , typename I1 , typename I2 >
concept | ranges::indirect_relation__concept_ = relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> && relation<F &, iter_value_t<I1> &, iter_reference_t<I2>> && relation<F &, iter_reference_t<I1>, iter_value_t<I2> &> && relation<F &, iter_reference_t<I1>, iter_reference_t<I2>> && relation<F &, iter_common_reference_t<I1>, iter_common_reference_t<I2>>
template<typename F , typename I1 , typename I2 = I1>
concept | ranges::indirect_strict_weak_order
template<typename F , typename I1 , typename I2 >
concept | ranges::indirect_strict_weak_order__concept_ = strict_weak_order<F &, iter_value_t<I1> &, iter_value_t<I2> &> && strict_weak_order<F &, iter_value_t<I1> &, iter_reference_t<I2>> && strict_weak_order<F &, iter_reference_t<I1>, iter_value_t<I2> &> && strict_weak_order<F &, iter_reference_t<I1>, iter_reference_t<I2>> && strict_weak_order<F &, iter_common_reference_t<I1>, iter_common_reference_t<I2>>
template<typename F , typename I >
concept | ranges::indirect_unary_predicate
template<typename F , typename I >
concept | ranges::indirect_unary_predicate__concept_ = predicate<F &, iter_value_t<I> &> && predicate<F &, iter_reference_t<I>> && predicate<F &, iter_common_reference_t<I>>
template<typename I1 , typename I2 , typename C , typename P1 = identity, typename P2 = identity>
concept | ranges::indirectly_comparable
template<typename I , typename O >
concept | ranges::indirectly_copyable
template<typename I , typename O >
concept | ranges::indirectly_copyable__concept_ = indirectly_writable<O, iter_reference_t<I>>
template<typename I , typename O >
concept | ranges::indirectly_copyable_storable
template<typename I , typename O >
concept | ranges::indirectly_copyable_storable__concept_ = indirectly_writable<O, iter_value_t<I> const &> && copyable<iter_value_t<I>> && constructible_from<iter_value_t<I>, iter_reference_t<I>> && assignable_from<iter_value_t<I> &, iter_reference_t<I>>
template<typename I , typename O >
concept | ranges::indirectly_movable
template<typename I , typename O >
concept | ranges::indirectly_movable__concept_ = indirectly_writable<O, iter_rvalue_reference_t<I>>
template<typename I , typename O >
concept | ranges::indirectly_movable_storable
template<typename I , typename O >
concept | ranges::indirectly_movable_storable__concept_ = indirectly_writable<O, iter_value_t<I>> && movable<iter_value_t<I>> && constructible_from<iter_value_t<I>, iter_rvalue_reference_t<I>> && assignable_from<iter_value_t<I> &, iter_rvalue_reference_t<I>>
template<typename F , typename I >
concept | ranges::indirectly_regular_unary_invocable
template<typename F , typename I >
concept | ranges::indirectly_regular_unary_invocable__concept_ = regular_invocable<F &, iter_value_t<I> &> && regular_invocable<F &, iter_reference_t<I>> && regular_invocable<F &, iter_common_reference_t<I>> && common_reference_with< invoke_result_t<F &, iter_value_t<I> &>, invoke_result_t<F &, iter_reference_t<I>>>
template<typename I1 , typename I2 >
concept | ranges::indirectly_swappable__requires_
template<typename F , typename I >
concept | ranges::indirectly_unary_invocable
template<typename I >
concept | ranges::input_iterator
template<typename I >
concept | ranges::input_or_output_iterator
template<typename I >
concept | ranges::input_or_output_iterator__concept_ = detail::dereferenceable_<I&>
template<typename I1 , typename I2 , typename Out , typename C = less, typename P1 = identity, typename P2 = identity>
concept | ranges::mergeable
template<typename Out , typename T >
concept | ranges::output_iterator__requires_
template<typename I >
concept | ranges::permutable
template<typename C , typename I1 , typename P1 , typename I2 , typename P2 >
concept | ranges::projected_indirect_relation__concept_ = indirect_relation<C, projected<I1, P1>, projected<I2, P2>>
template<typename C , typename I1 , typename P1 , typename I2 , typename P2 >
concept | ranges::projected_indirect_strict_weak_order__concept_ = indirect_strict_weak_order<C, projected<I1, P1>, projected<I2, P2>>
template<typename I >
concept | ranges::random_access_iterator
template<typename I >
concept | ranges::random_access_iterator__requires_ = CPP_REQUIRES_requires `(I i, iter_difference_t<I> n) ( i + n, n + i, i - n, i += n, i -= n, concepts::requires_<same_as<decltype(i + n), I>>, concepts::requires_<same_as<decltype(n + i), I>>, concepts::requires_<same_as<decltype(i - n), I>>, concepts::requires_<same_as<decltype(i += n), I&>>, concepts::requires_<same_as<decltype(i -= n), I&>>, concepts::requires_<same_as<decltype(i[n]), iter_reference_t<I>>> )
template<typename I >
constexpr bool | ranges::readable
template<typename I >
concept | ranges::readable__concept_
template<typename S , typename I >
concept | ranges::sentinel_for
template<typename S , typename I >
concept | ranges::sized_sentinel_for
template<typename S , typename I >
concept | ranges::sized_sentinel_for__requires_
template<typename I , typename C = less, typename P = identity>
concept | ranges::sortable
template<typename I >
concept | ranges::weakly_incrementable
template<typename I >
concept | ranges::weakly_incrementable__requires_
template<typename I , typename Tag >
concept | ranges::with_category__concept_ = derived_from<detail::iter_concept_t<I>, Tag>
template<typename O , typename T >
constexpr bool | ranges::writable
template<typename O , typename T >
concept | ranges::writable__requires_

## Variable Documentation

## ◆ bidirectional_iterator__requires_

template<typename I >

concept ranges::bidirectional_iterator__requires_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
= CPP_REQUIRES_requires `(I i)
template<typename I>
concept bidirectional_iterator =
forward_iterator<I> &&
ranges::bidirectional_iterator__requires_<I> &&
ranges::with_category__concept_<I, std::bidirectional_iterator_tag>

## ◆ contiguous_iterator

template<typename I >

concept ranges::contiguous_iterator

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
random_access_iterator<I> &&
ranges::contiguous_iterator__concept_<I>

## ◆ forward_iterator

template<typename I >

concept ranges::forward_iterator

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
input_iterator<I> &&
incrementable<I> &&
sentinel_for<I, I> &&
ranges::with_category__concept_<I, std::forward_iterator_tag>

## ◆ incrementable__requires_

template<typename I >

concept ranges::incrementable__requires_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
= CPP_REQUIRES_requires `(I i)
template<typename I>
concept incrementable =
regular<I> &&
weakly_incrementable<I> &&
ranges::incrementable__requires_<I>

## ◆ indirect_binary_predicate_

template<typename F , typename I1 , typename I2 >

concept ranges::indirect_binary_predicate_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I1> && indirectly_readable<I2> &&
copy_constructible<F> &&
ranges::indirect_binary_predicate_impl__concept_<F, I1, I2>

## ◆ indirect_relation

template<typename F , typename I1 , typename I2 = I1>

concept ranges::indirect_relation

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I1> && indirectly_readable<I2> &&
copy_constructible<F> &&
ranges::indirect_relation__concept_<F, I1, I2>

## ◆ indirect_strict_weak_order

template<typename F , typename I1 , typename I2 = I1>

concept ranges::indirect_strict_weak_order

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I1> && indirectly_readable<I2> &&
copy_constructible<F> &&
ranges::indirect_strict_weak_order__concept_<F, I1, I2>

## ◆ indirect_unary_predicate

template<typename F , typename I >

concept ranges::indirect_unary_predicate

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I> &&
copy_constructible<F> &&
ranges::indirect_unary_predicate__concept_<F, I>

## ◆ indirectly_comparable

template<typename I1 , typename I2 , typename C , typename P1 = identity, typename P2 = identity>

concept ranges::indirectly_comparable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
ranges::projected_indirect_relation__concept_<C, I1, P1, I2, P2>

## ◆ indirectly_copyable

template<typename I , typename O >

concept ranges::indirectly_copyable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I> && ranges::indirectly_copyable__concept_<I, O>

## ◆ indirectly_copyable_storable

template<typename I , typename O >

concept ranges::indirectly_copyable_storable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_copyable<I, O> &&
ranges::indirectly_copyable_storable__concept_<I, O>

## ◆ indirectly_movable

template<typename I , typename O >

concept ranges::indirectly_movable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I> && ranges::indirectly_movable__concept_<I, O>

## ◆ indirectly_movable_storable

template<typename I , typename O >

concept ranges::indirectly_movable_storable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_movable<I, O> &&
ranges::indirectly_movable_storable__concept_<I, O>

## ◆ indirectly_regular_unary_invocable

template<typename F , typename I >

concept ranges::indirectly_regular_unary_invocable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I> &&
copy_constructible<F> &&
ranges::indirectly_regular_unary_invocable__concept_<F, I>

## ◆ indirectly_swappable__requires_

template<typename I1 , typename I2 >

concept ranges::indirectly_swappable__requires_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
= CPP_REQUIRES_requires `(I1 const i1, I2 const i2)
template<typename I1, typename I2 = I1>
concept indirectly_swappable =
indirectly_readable<I1> &&
indirectly_readable<I2> &&
ranges::indirectly_swappable__requires_<I1, I2>

## ◆ indirectly_unary_invocable

template<typename F , typename I >

concept ranges::indirectly_unary_invocable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
detail::indirectly_unary_invocable_<F, I> &&
copy_constructible<F>

## ◆ input_iterator

template<typename I >

concept ranges::input_iterator

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
input_or_output_iterator<I> &&
indirectly_readable<I> &&
ranges::with_category__concept_<I, std::input_iterator_tag>

## ◆ input_or_output_iterator

template<typename I >

concept ranges::input_or_output_iterator

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
weakly_incrementable<I> &&
ranges::input_or_output_iterator__concept_<I>

## ◆ mergeable

template<typename I1 , typename I2 , typename Out , typename C = less, typename P1 = identity, typename P2 = identity>

concept ranges::mergeable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
input_iterator<I1> &&
input_iterator<I2> &&
weakly_incrementable<Out> &&
indirectly_copyable<I1, Out> &&
indirectly_copyable<I2, Out> &&
ranges::projected_indirect_strict_weak_order__concept_<C, I1, P1, I2, P2>

## ◆ output_iterator__requires_

template<typename Out , typename T >

concept ranges::output_iterator__requires_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
= CPP_REQUIRES_requires `(Out o, T && t)
template<typename Out, typename T>
concept output_iterator =
input_or_output_iterator<Out> &&
indirectly_writable<Out, T> &&
ranges::output_iterator__requires_<Out, T>

## ◆ permutable

template<typename I >

concept ranges::permutable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
forward_iterator<I> &&
indirectly_swappable<I, I> &&
indirectly_movable_storable<I, I>

## ◆ random_access_iterator

template<typename I >

concept ranges::random_access_iterator

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
bidirectional_iterator<I> &&
totally_ordered<I> &&
sized_sentinel_for<I, I> &&
ranges::random_access_iterator__requires_<I> &&
ranges::with_category__concept_<I, std::random_access_iterator_tag>

## ◆ readable

template<typename I >

constexpr bool ranges::readable
| constexpr

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_readable<I>

## ◆ readable__concept_

template<typename I >

concept ranges::readable__concept_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
template<typename I>
concept indirectly_readable =
ranges::readable__concept_<uncvref_t<I> >

## ◆ sentinel_for

template<typename S , typename I >

concept ranges::sentinel_for

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
semiregular<S> &&
input_or_output_iterator<I> &&
detail::weakly_equality_comparable_with_<S, I>

## ◆ sized_sentinel_for

template<typename S , typename I >

concept ranges::sized_sentinel_for

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
sized_sentinel_for__concept_<S, I> &&
ranges::sized_sentinel_for__requires_<S, I>

## ◆ sized_sentinel_for__requires_

template<typename S , typename I >

concept ranges::sized_sentinel_for__requires_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
= CPP_REQUIRES_requires `(S const & s, I const & i)
template<typename S, typename I > concept sized_sentinel_for__concept_ = (!disable_sized_sentinel<std::remove_cv_t<S>, std::remove_cv_t<I>>) && sentinel_for<S, I>

## ◆ sortable

template<typename I , typename C = less, typename P = identity>

concept ranges::sortable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
permutable<I> &&
ranges::projected_indirect_strict_weak_order__concept_<C, I, P, I, P>

## ◆ weakly_incrementable

template<typename I >

concept ranges::weakly_incrementable

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
semiregular<I> &&
ranges::weakly_incrementable__requires_<I> &&
ranges::weakly_incrementable__concept_<I>

## ◆ weakly_incrementable__requires_

template<typename I >

concept ranges::weakly_incrementable__requires_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
= CPP_REQUIRES_requires `(I i)
template<typename I > concept weakly_incrementable__concept_ = concepts::type<iter_difference_t<I>> && detail::signed_integer_like_<iter_difference_t<I>>

## ◆ writable

template<typename O , typename T >

constexpr bool ranges::writable
| constexpr

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
=
indirectly_writable<O, T>

## ◆ writable__requires_

template<typename O , typename T >

concept ranges::writable__requires_

`#include <range/v3/iterator/concepts.hpp>`

Initial value:
= CPP_REQUIRES_requires `(O && o, T && t)
template<typename O, typename T>
concept indirectly_writable =
ranges::writable__requires_<O, T>