Its been a while since I've programmed in C++ but I need to write a small
program.
The idea is that I need to do several nested for loops.
Since I don't think I can easily handle doing the loops directly, except
maybe through recursion but at a cost, I was thinking I could use templates
to generate the code. The problem is that I have completely forgot just
about everything I learned about templates.
What I want to do is have a template that will basicaly generate a nested
set of N for loops and supply me with an array like structure to access the
ith for loops current value.
Basicaly I need to do the code
for(i1 = 0; i1<= m; i1++)
for(i2 = 0; i2<= m; i2++)
.............
for(in = 0; in<= m; in++)
{
x = F[k]; // return's ik's current value...
// i.e., if k = 4, then x = i4
// code here
}
Technically I can't have ik = 1 but i think I could handle figuring that
out.
I work on trying to figure it out but right no my brain is fried and I'd
like to know if this is even possible before I try.
Thanks,
Jon