I have buffer: char line[1024] which contains a line read from a file.
I want to find the last new-line (\n) in it, then replace all , with (space) before it.
The code I came up with:
const auto end = rng::find(line | rng::views::reverse, '\n'); // Find last occurrence of `\n`
rng::replace(line, end, ',', ' '); // Replace all `,` with ` ` before it
But it doesn't work because the type of line is a simple pointer, while end is a borrowed_iterator<reverse_view<T>>.