26
Ranges library
[ranges]
26.7
Range adaptors
[range.adaptors]
26.7.17
Split view
[range.split]
26.7.17.1
Overview
[range.split.overview]
1
#
split_
view
takes a view and a delimiter, and splits the view into
subrange
s on the delimiter
.
The delimiter can be a single element or a view of elements
.
2
#
The name
views
::
split
denotes a range adaptor object (
[range.
adaptor.
object]
)
.
Given subexpressions
E
and
F
, the expression
views
::
split
(
E, F
)
is expression-equivalent to
split_
view
(
E, F
)
.
3
#
[
Example
1
:
string str
{
"the quick brown fox"
}
;
for
(
auto
word
:
views
::
split
(
str,
' '
)
)
{
cout
<
<
string_view
(
word
)
<
<
'*'
;
}
// The above prints
the*quick*brown*fox*
—
end example
]