asd wrote:
n < 0L is not constant or does not evaluate to a bool
(D2, OS X)
That's because n isn't a compile-time constant. You can't instantiate
a template with runtime variables.
that includes "runtime variables" used in CTFE (this is because CTFE functions
are also normal runtime functions).
In this case value of n is possible to know at compile time - it depends only
on compile-time input.
I'm not going to use this function at run time. Too bad I can't declare that :(
So write:
const int n = 0;