One case of array assignments

Marco Leise Marco.Leise at gmx.de
Tue Mar 12 10:19:58 PDT 2013


As long as this still works, as pointed out by Kenji:

  int[3] sa = 1;  // sa is initialized to [1, 1, 1]

I'm fine with disallowing:

  int[1][3] a2 = [1, 2, 3];

But that's probably only because you didn't say:

  int[100][3] a2 = [1, 2, 3];

:D

We should keep _some_ syntax for statically initializing an array
from a single element. It's a far too common task.



More information about the Digitalmars-d mailing list