Why can’t I pass a non-constant variable as a template argument?
What is the value of i (that is not a constant) at compile time? There is no way to answer unless executing the loop. But executing is not “compiling” Since there is no answer, the compiler cannot do that. Templates are not algorithm to be executed, but macros to be expanded to produce code. What … Read more