December 14, 2008 Why I can't use array in compile-time struct creation? | ||||
---|---|---|---|---|
| ||||
It is forbidden by specification, but an interesting reason. for example: struct S { static S opCall() { S res; int a,b,c,d; int[10] data; // If I comment out this line compilation goes smoothly return res; } } void main() { static S s = S(); } struct_array.d(14): Error: cannot evaluate opCall() at compile time struct_array.d(14): Error: cannot evaluate opCall() at compile time |
Copyright © 1999-2021 by the D Language Foundation