V Fri, 30 Jan 2015 01:08:30 +0000
bearophile via Digitalmars-d <[email protected]> napsáno:
> 
> It helps avoid bugs like:
> 
> int[5] a = [1,2,4,5];
> 

No, it makes more bugs possible

// this is compile error so its ok
int[MUST_HAVE_FIVE_ITEMS] a=[1,2,3,5];
// Error: mismatched array lengths, 5 and 4


// now this is compile error so its ok
int[$] a = [1,2,3,5]; // oops I miss one value
// but there is no error at compile time

Reply via email to