23 Ranges library [ranges]

23.5 Range requirements [range.req]

23.5.1 General [range.req.general]

Ranges are an abstraction that allow a C++ program to operate on elements of data structures uniformly.
Calling ranges::begin on a range returns an object whose type models Iterator.
Calling ranges::end on a range returns an object whose type S, together with the type I of the object returned by ranges::begin, models Sentinel<S, I>.
The library formalizes the interfaces, semantics, and complexity of ranges to enable algorithms and range adaptors that work efficiently on different types of sequences.
The Range concept requires that ranges::begin and ranges::end return an iterator and a sentinel, respectively.
The SizedRange concept refines Range with the requirement that the number of elements in the range can be determined in constant time using the ranges::size function.
The View concept specifies requirements on a Range type with constant-time copy and assign operations.
Several refinements of Range group requirements that arise frequently in concepts and algorithms.
Common ranges are ranges for which ranges::begin and ranges::end return objects of the same type.
Random access ranges are ranges for which ranges::begin returns a type that models RandomAccessIterator.
(Contiguous, bidirectional, forward, input, and output ranges are defined similarly.)
Viewable ranges can be converted to views.