tmp/tmpvy2hxvup/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Overview <a id="range.join.with.overview">[[range.join.with.overview]]</a>
|
| 2 |
+
|
| 3 |
+
`join_with_view` takes a view and a delimiter, and flattens the view,
|
| 4 |
+
inserting every element of the delimiter in between elements of the
|
| 5 |
+
view. The delimiter can be a single element or a view of elements.
|
| 6 |
+
|
| 7 |
+
The name `views::join_with` denotes a range adaptor object
|
| 8 |
+
[[range.adaptor.object]]. Given subexpressions `E` and `F`, the
|
| 9 |
+
expression `views::join_with(E, F)` is expression-equivalent to
|
| 10 |
+
`join_with_view(E, F)`.
|
| 11 |
+
|
| 12 |
+
[*Example 1*:
|
| 13 |
+
|
| 14 |
+
``` cpp
|
| 15 |
+
vector<string> vs = {"the", "quick", "brown", "fox"};
|
| 16 |
+
for (char c : vs | views::join_with('-')) {
|
| 17 |
+
cout << c;
|
| 18 |
+
}
|
| 19 |
+
// The above prints the-quick-brown-fox
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
— *end example*]
|
| 23 |
+
|