The C++23 std::views::cartesian_product is a view representing the n-ary cartesian product of the content of the views passed in as arguments.
Using std::views::cartesian_product, we can avoid using nested loops and indices.
Click to open in Compiler Explorer.
Leave a comment