tmp/tmp684mcjdp/{from.md → to.md}
RENAMED
|
@@ -1,26 +1,23 @@
|
|
| 1 |
#### Overview <a id="range.split.overview">[[range.split.overview]]</a>
|
| 2 |
|
| 3 |
-
`split_view` takes a
|
| 4 |
-
|
| 5 |
-
|
| 6 |
|
| 7 |
The name `views::split` denotes a range adaptor object
|
| 8 |
[[range.adaptor.object]]. Given subexpressions `E` and `F`, the
|
| 9 |
expression `views::split(E, F)` is expression-equivalent to
|
| 10 |
-
`split_view
|
| 11 |
|
| 12 |
[*Example 1*:
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
string str{"the quick brown fox"};
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
for (char ch : word)
|
| 19 |
-
cout << ch;
|
| 20 |
-
cout << '*';
|
| 21 |
}
|
| 22 |
-
// The above prints
|
| 23 |
```
|
| 24 |
|
| 25 |
— *end example*]
|
| 26 |
|
|
|
|
| 1 |
#### Overview <a id="range.split.overview">[[range.split.overview]]</a>
|
| 2 |
|
| 3 |
+
`split_view` takes a view and a delimiter, and splits the view into
|
| 4 |
+
`subrange`s on the delimiter. The delimiter can be a single element or a
|
| 5 |
+
view of elements.
|
| 6 |
|
| 7 |
The name `views::split` denotes a range adaptor object
|
| 8 |
[[range.adaptor.object]]. Given subexpressions `E` and `F`, the
|
| 9 |
expression `views::split(E, F)` is expression-equivalent to
|
| 10 |
+
`split_view(E, F)`.
|
| 11 |
|
| 12 |
[*Example 1*:
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
string str{"the quick brown fox"};
|
| 16 |
+
for (auto word : views::split(str, ' ')) {
|
| 17 |
+
cout << string_view(word) << '*';
|
|
|
|
|
|
|
|
|
|
| 18 |
}
|
| 19 |
+
// The above prints the*quick*brown*fox*
|
| 20 |
```
|
| 21 |
|
| 22 |
— *end example*]
|
| 23 |
|