Skip to content

Commit 71c72b2

Browse files
authored
[range.split] Fix invalid conversion in example (#6041)
Replaces an illegal implicit conversion from a range to string_view in the example with an explicit one. After P2499R0, it is no longer possible to implicitly construct a string_view from a range (like the ones produced by views::split).
1 parent f131b37 commit 71c72b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/ranges.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8146,8 +8146,8 @@
81468146
\begin{example}
81478147
\begin{codeblock}
81488148
string str{"the quick brown fox"};
8149-
for (string_view word : views::split(str, ' ')) {
8150-
cout << word << '*';
8149+
for (auto word : views::split(str, ' ')) {
8150+
cout << string_view(word) << '*';
81518151
}
81528152
// The above prints \tcode{the*quick*brown*fox*}
81538153
\end{codeblock}

0 commit comments

Comments
 (0)