Namespaces
Variants
Views
Actions

std::ranges::contiguous_range

From cppreference.com
< cpp‎ | ranges
Revision as of 05:28, 29 August 2019 by Fruderica (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 
 
Ranges library
Range adaptors
 
Defined in header <ranges>
template<class T>

  concept contiguous_range =
    ranges::random_access_range<T> &&
    std::contiguous_iterator<ranges::iterator_t<T>> &&
    requires(T& t) {
      { ranges::data(t) } ->
        std::same_as<std::add_pointer_t<ranges::range_reference_t<T>>>;

    };

The contiguous_range concept is a refinement of range for which ranges::begin returns a model of contiguous_iterator and the customization point ranges::data is usable.