tmp/tmpwmj8_x6p/{from.md → to.md}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
### Counted view <a id="range.counted">[[range.counted]]</a>
|
| 2 |
|
| 3 |
-
A counted view presents a
|
| 4 |
[[iterator.requirements.general]] `i`+\[0, `n`) for an iterator `i` and
|
| 5 |
non-negative integer `n`.
|
| 6 |
|
| 7 |
The name `views::counted` denotes a customization point object
|
| 8 |
[[customization.point.object]]. Let `E` and `F` be expressions, let `T`
|
|
@@ -15,11 +15,11 @@ be `decay_t<decltype((E))>`, and let `D` be `iter_difference_t<T>`. If
|
|
| 15 |
instantiation. — *end note*]
|
| 16 |
|
| 17 |
Otherwise, `views::counted(E, F)` is expression-equivalent to:
|
| 18 |
|
| 19 |
- If `T` models `contiguous_iterator`, then
|
| 20 |
-
`span
|
| 21 |
- Otherwise, if `T` models `random_access_iterator`, then
|
| 22 |
-
`subrange
|
| 23 |
only once.
|
| 24 |
-
- Otherwise, `subrange
|
| 25 |
|
|
|
|
| 1 |
### Counted view <a id="range.counted">[[range.counted]]</a>
|
| 2 |
|
| 3 |
+
A counted view presents a view of the elements of the counted range
|
| 4 |
[[iterator.requirements.general]] `i`+\[0, `n`) for an iterator `i` and
|
| 5 |
non-negative integer `n`.
|
| 6 |
|
| 7 |
The name `views::counted` denotes a customization point object
|
| 8 |
[[customization.point.object]]. Let `E` and `F` be expressions, let `T`
|
|
|
|
| 15 |
instantiation. — *end note*]
|
| 16 |
|
| 17 |
Otherwise, `views::counted(E, F)` is expression-equivalent to:
|
| 18 |
|
| 19 |
- If `T` models `contiguous_iterator`, then
|
| 20 |
+
`span(to_address(E), static_cast<size_t>(static_-{}cast<D>(F)))`.
|
| 21 |
- Otherwise, if `T` models `random_access_iterator`, then
|
| 22 |
+
`subrange(E, E + static_cast<D>(F))`, except that `E` is evaluated
|
| 23 |
only once.
|
| 24 |
+
- Otherwise, `subrange(counted_iterator(E, F), default_sentinel)`.
|
| 25 |
|