Static arrays, typeof and IFTI?
bearophile
bearophileHUGS at lycos.com
Tue Oct 11 09:54:20 PDT 2011
Andrei Alexandrescu:
> I was more enthused about that, but later I realized there are very few
> situations in which one reasonably has a fixed-size array that is large
> enough to make counting inadequate and is also updated often enough to
> make the feature worthwhile. It's one of those features that are nice to
> have but are not really missed in real code.
I am not going to appreciate a language/compiler that accepts and compiles this program silently. This trap has caused a bug in my code time ago:
int[3] a = [1, 2];
void main() {}
The usage of [$] in that case avoids that kind of bug...
Bye,
bearophile
More information about the Digitalmars-d
mailing list