[range.req.general] (original) (raw)
25 Ranges library [ranges]
25.4 Range requirements [range.req]
25.4.1 General [range.req.general]
Ranges are an abstraction that allows a C++ program to operate on elements of data structures uniformly.
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_for<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 thatranges::begin and ranges::endreturn an iterator and a sentinel, respectively.
The sized_range concept refines range with the requirement that ranges::size be amortized .
The view concept specifies requirements on a range type to provide operations with predictable complexity.
Several refinements of range group requirements that arise frequently in concepts and algorithms.
Common ranges are ranges for whichranges::begin and ranges::endreturn objects of the same type.
(Contiguous, bidirectional, forward, input, and output ranges are defined similarly.)
Viewable ranges can be converted to views.