tmp/tmpxxtenr6r/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,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 |
+
subranges 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 |
+
split_view sentence{str, ' '};
|
| 17 |
+
for (auto word : sentence) {
|
| 18 |
+
for (char ch : word)
|
| 19 |
+
cout << ch;
|
| 20 |
+
cout << '*';
|
| 21 |
+
}
|
| 22 |
+
// The above prints: the*quick*brown*fox*
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
— *end example*]
|
| 26 |
+
|