Automatic static array length

Your Name email at example.org
Wed Dec 26 22:23:02 UTC 2018


Is there a way to declare a static array with an automatic 
length, so that it doesn't have to be manually calculated?

Perhaps something like this:
int[auto] arr = [12, 23, 54, 653, 2, 6432, 345, 435, 26];

the current way to do it is this:
int[9] arr = [12, 23, 54, 653, 2, 6432, 345, 435, 26];

But then you have to manually count the items, and update the 
number each time the array is changed.

Is there any way to declare a static array with an automatically 
inferred length?


More information about the Digitalmars-d mailing list