0

If I had n vectors I could do something like:

for(auto& i : v1) {
    for(auto& j: v2) {
       ...
           for(auto& z: vn){
                 f(i,j,k,...,z)
           }
     }
}

but since the vectors over which compute the cartesian product are not known until the user provides some inputs at runtime, I don't know how could I compute the product.

I tried looking up something in the library but I couldn't find anything.

ninazzo
  • 547
  • 1
  • 6
  • 17
  • If you only know the number of vectors at run time, then you can't (or shouldn't) be using variables. Do you have a `vector>` or something else? That's important to figure out the appropriate solution. – cigien May 28 '20 at 21:36
  • yes, I have a `vector>` – ninazzo May 28 '20 at 21:37

0 Answers0