I have a C++ snippet below with a run-time for loop,
for
for(int i = 0; i < I; i++) for (int j = 0; j < J; j++) A( row(i,j), column(i,j)
Check out Template Metaprograms and the bubble sort implementations.