tmp/tmpbcde07z9/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### General <a id="range.req.general">[[range.req.general]]</a>
|
| 2 |
+
|
| 3 |
+
Ranges are an abstraction that allow a C++ program to operate on
|
| 4 |
+
elements of data structures uniformly. Calling `ranges::begin` on a
|
| 5 |
+
range returns an object whose type models `input_or_output_iterator`
|
| 6 |
+
[[iterator.concept.iterator]]. Calling `ranges::end` on a range returns
|
| 7 |
+
an object whose type `S`, together with the type `I` of the object
|
| 8 |
+
returned by `ranges::begin`, models `sentinel_for<S, I>`. The library
|
| 9 |
+
formalizes the interfaces, semantics, and complexity of ranges to enable
|
| 10 |
+
algorithms and range adaptors that work efficiently on different types
|
| 11 |
+
of sequences.
|
| 12 |
+
|
| 13 |
+
The `range` concept requires that `ranges::begin` and `ranges::end`
|
| 14 |
+
return an iterator and a sentinel, respectively. The `sized_range`
|
| 15 |
+
concept refines `range` with the requirement that `ranges::size` be
|
| 16 |
+
amortized 𝑂(1). The `view` concept specifies requirements on a `range`
|
| 17 |
+
type with constant-time destruction and move operations.
|
| 18 |
+
|
| 19 |
+
Several refinements of `range` group requirements that arise frequently
|
| 20 |
+
in concepts and algorithms. Common ranges are ranges for which
|
| 21 |
+
`ranges::begin` and `ranges::end` return objects of the same type.
|
| 22 |
+
Random access ranges are ranges for which `ranges::begin` returns a type
|
| 23 |
+
that models `random_access_iterator` [[iterator.concept.random.access]].
|
| 24 |
+
(Contiguous, bidirectional, forward, input, and output ranges are
|
| 25 |
+
defined similarly.) Viewable ranges can be converted to views.
|
| 26 |
+
|