25
Ranges library
[ranges]
25.7
Range adaptors
[range.adaptors]
25.7.15
Join with view
[range.join.with]
25.7.15.1
Overview
[range.join.with.overview]
1
#
join_
with_
view
takes a view and a delimiter, and flattens the view, inserting every element of the delimiter in between elements of the view
.
The delimiter can be a single element or a view of elements
.
2
#
The name
views
::
join_
with
denotes a range adaptor object (
[range.
adaptor.
object]
)
.
Given subexpressions
E
and
F
, the expression
views
::
join_
with
(
E, F
)
is expression-equivalent to
join_
with_
view
(
E, F
)
.
3
#
[
Example
1
:
vector
<
string
>
vs
=
{
"the"
,
"quick"
,
"brown"
,
"fox"
}
;
for
(
char
c
:
vs
|
views
::
join_with
(
'-'
)
)
{
cout
<
<
c;
}
// The above prints
the-quick-brown-fox
—
end example
]