Daily bit(e) of C++ | std::views::as_rvalue
Daily bit(e) of C++ ♻️96, The view that casts all elements of the wrapped range to rvalues: std::views::as_rvalue.
The C++23 std::views::as_rvalue is a view of the wrapped range with each element cast to an rvalue. The behaviour is equivalent to the C++11 iterator adaptor std::move_iterator.
Casting elements of a range to r-values is useful when the intention is to consume each element while avoiding excessive copies.