What do you think is the best way to generate nested for loops using template metaprogramming? I'm making a library that performs basic vector and matrix algebra (I know about blitz++, but it does not have everything I want fore example N-Dimensional Cross Products, RREF and Determinants.). Currently, I need to compute the product of two matrices. I have looked at the blitz library implementation, but I couldn't figure out how all the elements were accessed using his algorithm. Perhaps one of you have also looked into this and know how it was done? Otherwise, I will just use a nested loop. There is nothing wrong with that right? Thanks.