Static arrays, typeof and IFTI?
bearophile
bearophileHUGS at lycos.com
Tue Oct 11 00:56:13 PDT 2011
Norbert Nemec:
> However there does not seem to be any way to state
> int[...whatever...] myvar = [1,2,3,4];
> enum N = typeof(myvar).init.length;
> and let the compiler deduce that N==4.
Since years some people (among them there is me too) are asking for this syntax:
int arr[$] = [1,2,3,4];
Vote for it here (an enhancement request from 2006!):
http://d.puremagic.com/issues/show_bug.cgi?id=481
Bye,
bearophile
More information about the Digitalmars-d
mailing list