23 Ranges library [ranges]

23.8 Range adaptors [range.adaptors]

23.8.9 Counted view [range.counted]

The name view::counted denotes a customization point object.
Let E and F be expressions, and let T be decay_­t<decltype((E))>.
Then the expression view::counted(E, F) is expression-equivalent to:
  • If T models Iterator and decltype((F)) models ConvertibleTo<iter_­difference_­t<T>>,
    • subrange{E, E + static_­cast<iter_­difference_­t<T>>(F)} if T models RandomAccessIterator.
    • Otherwise, subrange{counted_­iterator{E, F}, default_­sentinel}.
  • Otherwise, view::counted(E, F) is ill-formed.
    This case can result in substitution failure when view::counted(E, F) appears in the immediate context of a template instantiation.
    end note