In order to increase performance at runtime is there a possibility to force the compiler to role out such a for loop with compiler known count of iterations?
Such that this code.
template <int dim>
void foo()
{
...
int temp[i];
for(int i=0; i<dim; i++)
{
temp[i] = ...;
...
}
...
}
is build as it would be
template <int dim>
void foo()
{
...
int temp[i];
temp[0] = ...;
temp[1] = ...;
temp[2] = ...;
(...)
temp[dim-1] = ...;
...
}
...
}