Daily bit(e) of C++ | std::views::all
Daily bit(e) of C++ #432, Correctly handling borrowed and temporary ranges using std::views::all.
The std::views::all may seem a bit pointless, producing a view of all elements in a range.
However, std::views::all will produce different types based on the value category of the argument and whether it is a borrowed range, ensuring that we don't end up with a dangling view.
The resulting type can also be accessed through a helper std::views::all_t.