26 Ranges library [ranges]

26.4 Range requirements [range.req]

26.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]).
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 1:
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>>;
template<class R> inline constexpr bool is-initializer-list = see below; // exposition only
For a type R, is-initializer-list<R> is true if and only if remove_­cvref_­t<R> is a specialization of initializer_­list.
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> && ((view<remove_cvref_t<T>> && constructible_­from<remove_cvref_t<T>, T>) || (!view<remove_cvref_t<T>> && (is_lvalue_reference_v<T> || (movable<remove_reference_t<T>> && !is-initializer-list<T>))));
The constant_­range concept specifies the requirements of a range type whose elements are not modifiable.
template<class T> concept constant_­range = input_­range<T> && constant-iterator<iterator_t<T>>;