I want to unroll the below nested loop at compile time. I have some code and a condition after every 'for' loop as shown in the code snippet below. I found ways to unroll it without any code (and conditions) between nested 'for' loops using template metaprogramming, but that did not help for my use case. I am looking for a way for my below example. I would really appreciate your help!
for (i=0;i<2;i++)
{
  //some code
  if (some condition using i)
  { 
    for(j=0;j<12;j++)
    {
       //some code
       if (another condition using j)
       {
         for(k=0;k<10;k++)
         {
           //some code
         }
       }
     }
   }
}