jeudi 16 juin 2016

Is there some STL function to get cartesian product of two C++ vectors?


Suppose

b =  ["good ", "bad "]
a  = ["apple","mango"]
then output = ["good apple","good mango","bad apple","bad mango"]

I know this can be done with nested for loops but is there some elegant one liner for doing this using C++ STL?


Aucun commentaire:

Enregistrer un commentaire