I have a list of list . All elements will be inserted at run-time. i wish to try all combinations through all list. So the simple solution comes to mind as
for ( l1 in L1)
{ for ( l2 in L2)
{ for ( l3 in L3)
{
... // use the pair (l1,l2,l3)
}
}
}
But i dont know the number of fors required at compile time. So how do i iterate through all pairs within c++?
Use recursion.