Iterator Concepts
Iterator

Iterator concepts. More...

## 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

concept indirectly_writable< O, iter_value_t< I > const & > &&copyable< iter_value_t< I > > &&constructible_from< iter_value_t< I >, iter_reference_t< I > > && | ranges::assignable_from< iter_value_t< I > &, iter_reference_t< I > >
concept indirectly_writable< O, iter_value_t< I > > &&movable< iter_value_t< I > > &&constructible_from< iter_value_t< I >, iter_rvalue_reference_t< I > > && | ranges::assignable_from< iter_value_t< I > &, iter_rvalue_reference_t< I > >
template<typename I >
concept | ranges::bbidirectional_iterator
| \concept bidirectional_iterator More...
template<typename I >
concept | ranges::bidirectional_iterator_ = requires( I i ) { --i, i--, concepts::requires_<same_as<I&, decltype(--i)>>, concepts::requires_<same_as<I, decltype(i--)>> ; }
| \concept bidirectional_iterator_ More...
template<typename I >
concept | ranges::ccontiguous_iterator
| \concept contiguous_iterator More...
concept regular_invocable< F &, iter_value_t< I > & > &&regular_invocable< F &, iter_reference_t< I > > &&regular_invocable< F &, iter_common_reference_t< I > > && | ranges::common_reference_with< invoke_result_t< F &, iter_value_t< I > & >, invoke_result_t< F &, iter_reference_t< I > > >

concept same_as< iter_reference_t< I const >, iter_reference_t< I > > &&same_as< iter_rvalue_reference_t< I const >, iter_rvalue_reference_t< I > > &&common_reference_with< iter_reference_t< I > &&, iter_value_t< I > & > &&common_reference_with< iter_reference_t< I > &&, iter_rvalue_reference_t< I > && > &&

ranges::common_reference_with< iter_rvalue_reference_t< I > &&, iter_value_t< I > const & >

concept | ranges::contiguous_iterator_ =
template<typename I >
concept | ranges::fforward_iterator
| \concept forward_iterator More...
template<typename I >
concept | ranges::iincrementable
| \concept incrementable More...
template<typename F , typename I1 , typename I2 >
concept | ranges::iindirect_binary_predicate_
| \concept indirect_binary_predicate_ More...
template<typename F , typename I1 , typename I2 = I1>
concept | ranges::iindirect_relation
| \concept indirect_relation More...
template<typename F , typename I1 , typename I2 = I1>
concept | ranges::iindirect_strict_weak_order
| \concept indirect_strict_weak_order More...
template<typename F , typename I >
concept | ranges::iindirect_unary_predicate
| \concept indirect_unary_predicate More...
template<typename I1 , typename I2 , typename C , typename P1 = identity, typename P2 = identity>
concept | ranges::iindirectly_comparable
| \concept indirectly_comparable More...
template<typename I , typename O >
concept | ranges::iindirectly_copyable
| \concept indirectly_copyable More...
template<typename I , typename O >
concept | ranges::iindirectly_copyable_storable
| \concept indirectly_copyable_storable More...
template<typename I , typename O >
concept | ranges::iindirectly_movable
| \concept indirectly_movable More...
template<typename I , typename O >
concept | ranges::iindirectly_movable_storable
| \concept indirectly_movable_storable More...
template<typename I >
concept | ranges::iindirectly_readable
| \concept indirectly_readable More...
template<typename F , typename I >
concept | ranges::iindirectly_regular_unary_invocable
| \concept indirectly_regular_unary_invocable More...
template<typename I1 , typename I2 = I1>
concept | ranges::iindirectly_swappable
| \concept indirectly_swappable More...
template<typename F , typename I >
concept | ranges::iindirectly_unary_invocable
| \concept indirectly_unary_invocable More...
template<typename O , typename T >
concept | ranges::iindirectly_writable
| \concept indirectly_writable More...
template<typename I >
concept | ranges::iinput_iterator
| \concept input_iterator More...
template<typename I >
concept | ranges::iinput_or_output_iterator
| \concept input_or_output_iterator More...
template<typename I >
concept | ranges::incrementable_ = requires( I i ) { concepts::requires_<same_as<I, decltype(i++)>> ; }
| \concept incrementable_ More...
concept | ranges::indirect_binary_predicate_impl_ =
concept | ranges::indirect_relation< C, projected< I1, P1 >, projected< I2, P2 > >
concept | ranges::indirect_relation_ =
concept | ranges::indirect_strict_weak_order< C, projected< I1, P1 >, projected< I2, P2 > >
concept | ranges::indirect_strict_weak_order_ =
concept | ranges::indirect_unary_predicate_ =
concept | ranges::indirectly_copyable_ =
concept | ranges::indirectly_copyable_storable_ =
concept | ranges::indirectly_movable_ =
concept | ranges::indirectly_movable_storable_ =
concept | ranges::indirectly_regular_unary_invocable_ =
template<typename I1 , typename I2 >
concept | ranges::indirectly_swappable_ = requires( I1 const i1, I2 const i2 ) { ranges::iter_swap(i1, i2), ranges::iter_swap(i1, i1), ranges::iter_swap(i2, i2), ranges::iter_swap(i2, i1) ; }
| \concept indirectly_swappable_ More...
concept | ranges::indirectly_writable< O, iter_reference_t< I > >
concept | ranges::indirectly_writable< O, iter_rvalue_reference_t< I > >
concept | ranges::input_or_output_iterator_ =
template<typename I1 , typename I2 , typename Out , typename C = less, typename P1 = identity, typename P2 = identity>
concept | ranges::mmergeable
template<typename Out , typename T >
concept | ranges::ooutput_iterator
| \concept output_iterator More...
template<typename Out , typename T >
concept | ranges::output_iterator_ = requires( Out o, T && t ) { *o++ = (T &&) t ; }
| \concept output_iterator_ More...
template<typename I >
concept | ranges::ppermutable
| \concept permutable More...
concept predicate< F &, iter_value_t< I > & > &&predicate< F &, iter_reference_t< I > > && | ranges::predicate< F &, iter_common_reference_t< I > >
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 > > && | ranges::predicate< F &, iter_common_reference_t< I1 >, iter_common_reference_t< I2 > >
concept | ranges::projected_indirect_relation_ =
concept | ranges::projected_indirect_strict_weak_order_ =
template<typename I >

concept

ranges::random_access_iterator_ = 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>>> ; }

| \concept random_access_iterator_ More...
template<typename I >
constexpr bool | ranges::readable
concept | ranges::readable_ =
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 > > && | ranges::relation< F &, iter_common_reference_t< I1 >, iter_common_reference_t< I2 > >
template<typename I >
concept | ranges::rrandom_access_iterator
| \concept random_access_iterator More...
concept !disable_sized_sentinel< std::remove_cv_t< S >, std::remove_cv_t< I > > && | ranges::sentinel_for< S, I >
template<typename S , typename I >
concept | ranges::sized_sentinel_for_ = requires( S const & s, I const & i ) { s - i, i - s, concepts::requires_<same_as<iter_difference_t<I>, decltype(s - i)>>, concepts::requires_<same_as<iter_difference_t<I>, decltype(i - s)>> ; }
| \concept sized_sentinel_for_ More...
template<typename S , typename I >
concept | ranges::ssentinel_for
| \concept sentinel_for More...
template<typename S , typename I >
concept | ranges::ssized_sentinel_for
| \concept sized_sentinel_for More...
template<typename I , typename C = less, typename P = identity>
concept | ranges::ssortable
| \concept sortable More...
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 > > && | ranges::strict_weak_order< F &, iter_common_reference_t< I1 >, iter_common_reference_t< I2 > >
template<typename I >
concept | ranges::weakly_incrementable_ = requires( I i ) { ++i, i++, concepts::requires_<same_as<I&, decltype(++i)>> ; }
| \concept weakly_incrementable_ More...
concept | ranges::with_category_ =
template<typename O , typename T >
constexpr bool | ranges::writable
template<typename O , typename T >
concept | ranges::writable_ = requires( O && o, T && t ) { *o = (T &&) t, *(O &&) o = (T &&) t, const_cast<iter_reference_t<O> const &&>(*o) = (T &&) t, const_cast<iter_reference_t<O> const &&>(*(O &&) o) = (T &&) t ; }
| \concept writable_ More...
template<typename I >
concept | ranges::wweakly_incrementable
| \concept weakly_incrementable More...

## Detailed Description

Iterator concepts.

## Variable Documentation

## bbidirectional_iterator

template<typename I >

concept ranges::bbidirectional_iterator

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

Initial value:
=
forward_iterator<I> &&
ranges::bidirectional_iterator_ < I > &&
ranges::with_category_ < I, std::bidirectional_iterator_tag >

\concept bidirectional_iterator

The `bidirectional_iterator` concept

## bidirectional_iterator_

template<typename I >

concept ranges::bidirectional_iterator_ = requires( I i ) { --i, i--, concepts::requires_<same_as<I&, decltype(--i)>>, concepts::requires_<same_as<I, decltype(i--)>> ; }

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

\concept bidirectional_iterator_

The `bidirectional_iterator_` concept

## ccontiguous_iterator

template<typename I >

concept ranges::ccontiguous_iterator

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

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

\concept contiguous_iterator

The `contiguous_iterator` concept

## fforward_iterator

template<typename I >

concept ranges::fforward_iterator

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

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

\concept forward_iterator

The `forward_iterator` concept

## iincrementable

template<typename I >

concept ranges::iincrementable

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

Initial value:
=
regular<I> &&
weakly_incrementable<I> &&
ranges::incrementable_ < I >

\concept incrementable

The `incrementable` concept

## iindirect_binary_predicate_

template<typename F , typename I1 , typename I2 >

concept ranges::iindirect_binary_predicate_

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

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

\concept indirect_binary_predicate_

The `indirect_binary_predicate_` concept

## iindirect_relation

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

concept ranges::iindirect_relation

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

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

\concept indirect_relation

The `indirect_relation` concept

## iindirect_strict_weak_order

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

concept ranges::iindirect_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_ < F, I1, I2 >

\concept indirect_strict_weak_order

The `indirect_strict_weak_order` concept

## iindirect_unary_predicate

template<typename F , typename I >

concept ranges::iindirect_unary_predicate

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

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

\concept indirect_unary_predicate

The `indirect_unary_predicate` concept

## iindirectly_comparable

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

concept ranges::iindirectly_comparable

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

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

\concept indirectly_comparable

The `indirectly_comparable` concept

## iindirectly_copyable

template<typename I , typename O >

concept ranges::iindirectly_copyable

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

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

\concept indirectly_copyable

The `indirectly_copyable` concept

## iindirectly_copyable_storable

template<typename I , typename O >

concept ranges::iindirectly_copyable_storable

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

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

\concept indirectly_copyable_storable

The `indirectly_copyable_storable` concept

## iindirectly_movable

template<typename I , typename O >

concept ranges::iindirectly_movable

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

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

\concept indirectly_movable

The `indirectly_movable` concept

## iindirectly_movable_storable

template<typename I , typename O >

concept ranges::iindirectly_movable_storable

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

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

\concept indirectly_movable_storable

The `indirectly_movable_storable` concept

## iindirectly_readable

template<typename I >

concept ranges::iindirectly_readable

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

Initial value:
=
ranges::readable_ < uncvref_t<I> >

\concept indirectly_readable

The `indirectly_readable` concept

## iindirectly_regular_unary_invocable

template<typename F , typename I >

concept ranges::iindirectly_regular_unary_invocable

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

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

\concept indirectly_regular_unary_invocable

The `indirectly_regular_unary_invocable` concept

## iindirectly_swappable

template<typename I1 , typename I2 = I1>

concept ranges::iindirectly_swappable

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

Initial value:
=
indirectly_readable<I1> &&
indirectly_readable<I2> &&
ranges::indirectly_swappable_ < I1, I2 >

\concept indirectly_swappable

The `indirectly_swappable` concept

## iindirectly_unary_invocable

template<typename F , typename I >

concept ranges::iindirectly_unary_invocable

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

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

\concept indirectly_unary_invocable

The `indirectly_unary_invocable` concept

## iindirectly_writable

template<typename O , typename T >

concept ranges::iindirectly_writable

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

Initial value:
=
ranges::writable_ < O, T >

\concept indirectly_writable

The `indirectly_writable` concept

## iinput_iterator

template<typename I >

concept ranges::iinput_iterator

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

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

\concept input_iterator

The `input_iterator` concept

## iinput_or_output_iterator

template<typename I >

concept ranges::iinput_or_output_iterator

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

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

\concept input_or_output_iterator

The `input_or_output_iterator` concept

## incrementable_

template<typename I >

concept ranges::incrementable_ = requires( I i ) { concepts::requires_<same_as<I, decltype(i++)>> ; }

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

\concept incrementable_

The `incrementable_` concept

## indirectly_swappable_

template<typename I1 , typename I2 >

concept ranges::indirectly_swappable_ = requires( I1 const i1, I2 const i2 ) { ranges::iter_swap(i1, i2), ranges::iter_swap(i1, i1), ranges::iter_swap(i2, i2), ranges::iter_swap(i2, i1) ; }

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

\concept indirectly_swappable_

The `indirectly_swappable_` concept

## mmergeable

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

concept ranges::mmergeable

`#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_ < C, I1, P1, I2, P2 >

## ooutput_iterator

template<typename Out , typename T >

concept ranges::ooutput_iterator

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

Initial value:
=
input_or_output_iterator<Out> &&
indirectly_writable<Out, T> &&
ranges::output_iterator_ < Out, T >

\concept output_iterator

The `output_iterator` concept

## output_iterator_

template<typename Out , typename T >

concept ranges::output_iterator_ = requires( Out o, T && t ) { *o++ = (T &&) t ; }

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

\concept output_iterator_

The `output_iterator_` concept

## ppermutable

template<typename I >

concept ranges::ppermutable

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

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

\concept permutable

The `permutable` concept

## random_access_iterator_

template<typename I >

concept ranges::random_access_iterator_ = 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>>> ; }

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

\concept random_access_iterator_

The `random_access_iterator_` concept

## readable

template<typename I >

constexpr bool ranges::readable

constexpr

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

Initial value:
=
indirectly_readable<I>

## rrandom_access_iterator

template<typename I >

concept ranges::rrandom_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_ < I > &&
ranges::with_category_ < I, std::random_access_iterator_tag >

\concept random_access_iterator

The `random_access_iterator` concept

## sized_sentinel_for_

template<typename S , typename I >

concept ranges::sized_sentinel_for_ = requires( S const & s, I const & i ) { s - i, i - s, concepts::requires_<same_as<iter_difference_t<I>, decltype(s - i)>>, concepts::requires_<same_as<iter_difference_t<I>, decltype(i - s)>> ; }

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

\concept sized_sentinel_for_

The `sized_sentinel_for_` concept

## ssentinel_for

template<typename S , typename I >

concept ranges::ssentinel_for

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

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

\concept sentinel_for

The `sentinel_for` concept

## ssized_sentinel_for

template<typename S , typename I >

concept ranges::ssized_sentinel_for

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

Initial value:
=
sized_sentinel_for_ < S, I > &&
ranges::sized_sentinel_for_ < S, I >

\concept sized_sentinel_for

The `sized_sentinel_for` concept

## ssortable

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

concept ranges::ssortable

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

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

\concept sortable

The `sortable` concept

## weakly_incrementable_

template<typename I >

concept ranges::weakly_incrementable_ = requires( I i ) { ++i, i++, concepts::requires_<same_as<I&, decltype(++i)>> ; }

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

\concept weakly_incrementable_

The `weakly_incrementable_` concept

## writable

template<typename O , typename T >

constexpr bool ranges::writable

constexpr

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

Initial value:
=
indirectly_writable<O, T>

## writable_

template<typename O , typename T >

concept ranges::writable_ = requires( O && o, T && t ) { *o = (T &&) t, *(O &&) o = (T &&) t, const_cast<iter_reference_t<O> const &&>(*o) = (T &&) t, const_cast<iter_reference_t<O> const &&>(*(O &&) o) = (T &&) t ; }

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

\concept writable_

The `writable_` concept

## wweakly_incrementable

template<typename I >

concept ranges::wweakly_incrementable

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

Initial value:
=
copyable<I> &&
ranges::weakly_incrementable_ < I > &&
ranges::weakly_incrementable_ < I >

\concept weakly_incrementable

The `weakly_incrementable` concept