Open bmanga opened 4 years ago
Thanks for the bug report. This doesn't seem to be specific to GCC, but occurs with Clang as well. I think the problem is that the views::split
adaptor should be wrapping the passed-in ranges with views::all
, but isn't doing so right now.
In the mean time, there are a couple of workarounds. You can either manually wrap the delimiter with views::all
yourself:
auto foo = words | rng::views::split(rng::views::all(delimiter));
or alternatively, use a char
as the delimiter rather than a string
:
char delimiter = ';';
auto foo = words | rng::views::split(delimiter);
Thanks for the suggestions!
Funnily enough, using std::string_view
for delimiter
also seems to work.
Hi, it seems that
nano::split_view
does not work as expected for a simple case (at least on gcc 8-9-trunk):Godbolt link