The C++23 std::ranges::to is a simple utility that eagerly evaluates a view and stores the result in the specified container type.
The element type can be left out and will then be deduced using CTAD (matching the element type of the view).
Click to open in Compiler Explorer.
Leave a comment