May 30, 2004 Segmentation fault on linux | ||||
---|---|---|---|---|
| ||||
When trying to compile template pow(x, int n) { static assert(n>=0); enum {pow = pow!(x,n % 2) * pow!(x*x,n/2)} } template pow(x,int n:1) { enum {pow= x} } template pow(x,int n:0) { enum {pow= 1} } int main() { printf("%d\n",pow!(3,4)); } I get template instance pow!(3,4) does not match any template declaration Segmentation fault |
Copyright © 1999-2021 by the D Language Foundation