I found a code here Printing 1 to 1000 without loop or conditionals
Can someone please explain how compile time recursion works, couldn\'t find it in google
Simple enough, each template instanciation create a new function with the changed parameter. Like if you defined: f1_1000(), f1_999() and so on.
Each function call the function with 1 less in it's name. As there is a different template, not recursive, to define f1_1() we also have a stop case.