24 Ranges library [ranges]

24.4 Range requirements [range.req]

24.4.5 Other range refinements [range.refinements]

The output_­range concept specifies requirements of a range type for which ranges​::​begin returns a model of output_­iterator ([iterator.concept.output]).
input_­range, forward_­range, bidirectional_­range, and random_­access_­range are defined similarly.
template<class R, class T> concept output_­range = range<R> && output_­iterator<iterator_t<R>, T>; template<class T> concept input_­range = range<T> && input_­iterator<iterator_t<T>>; template<class T> concept forward_­range = input_­range<T> && forward_­iterator<iterator_t<T>>; template<class T> concept bidirectional_­range = forward_­range<T> && bidirectional_­iterator<iterator_t<T>>; template<class T> concept random_­access_­range = bidirectional_­range<T> && random_­access_­iterator<iterator_t<T>>;
contiguous_­range additionally requires that the ranges​::​data customization point object ([range.prim.data]) is usable with the range.
template<class T> concept contiguous_­range = random_­access_­range<T> && contiguous_iterator<iterator_t<T>> && requires(T& t) { { ranges::data(t) } -> same_­as<add_pointer_t<range_reference_t<T>>>; };
Given an expression t such that decltype((t)) is T&, T models contiguous_­range only if to_­address(​ranges​::​begin(t)) == ranges​::​data(t) is true.
The common_­range concept specifies requirements of a range type for which ranges​::​begin and ranges​::​end return objects of the same type.
[Example
:
The standard containers ([containers]) model common_­range.
— end example
]
template<class T> concept common_­range = range<T> && same_­as<iterator_t<T>, sentinel_t<T>>;
The viewable_­range concept specifies the requirements of a range type that can be converted to a view safely.
template<class T> concept viewable_­range = range<T> && (borrowed_range<T> || view<remove_cvref_t<T>>);