tmp/tmp03biev6m/{from.md → to.md}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
#### Overview <a id="range.common.overview">[[range.common.overview]]</a>
|
| 2 |
|
| 3 |
-
`common_view` takes a
|
| 4 |
-
and sentinel and turns it into a
|
| 5 |
iterator and sentinel of the same type.
|
| 6 |
|
| 7 |
[*Note 1*: `common_view` is useful for calling legacy algorithms that
|
| 8 |
expect a range’s iterator and sentinel types to be the
|
| 9 |
same. — *end note*]
|
|
@@ -23,11 +23,11 @@ The name `views::common` denotes a range adaptor object
|
|
| 23 |
template<class ForwardIterator>
|
| 24 |
size_t count(ForwardIterator first, ForwardIterator last);
|
| 25 |
|
| 26 |
template<forward_range R>
|
| 27 |
void my_algo(R&& r) {
|
| 28 |
-
auto&& common =
|
| 29 |
auto cnt = count(common.begin(), common.end());
|
| 30 |
// ...
|
| 31 |
}
|
| 32 |
```
|
| 33 |
|
|
|
|
| 1 |
#### Overview <a id="range.common.overview">[[range.common.overview]]</a>
|
| 2 |
|
| 3 |
+
`common_view` takes a view which has different types for its iterator
|
| 4 |
+
and sentinel and turns it into a view of the same elements with an
|
| 5 |
iterator and sentinel of the same type.
|
| 6 |
|
| 7 |
[*Note 1*: `common_view` is useful for calling legacy algorithms that
|
| 8 |
expect a range’s iterator and sentinel types to be the
|
| 9 |
same. — *end note*]
|
|
|
|
| 23 |
template<class ForwardIterator>
|
| 24 |
size_t count(ForwardIterator first, ForwardIterator last);
|
| 25 |
|
| 26 |
template<forward_range R>
|
| 27 |
void my_algo(R&& r) {
|
| 28 |
+
auto&& common = views::common(r);
|
| 29 |
auto cnt = count(common.begin(), common.end());
|
| 30 |
// ...
|
| 31 |
}
|
| 32 |
```
|
| 33 |
|