Static arrays, typeof and IFTI?
David Gileadi
gileadis at NSPMgmail.com
Tue Oct 11 14:06:04 PDT 2011
On 10/11/11 1:46 PM, simendsjo wrote:
> // It's important that a has a length of 3, so I specify it
> int[3] a = [1, 2]
> Error: Not enough values for a. Expected 3, got 2
>
> // I don't care what length a has as long as it has a static length
> int[$] a = [1, 2];
It would be nice if this were coupled with an earlier suggestion:
// large buffer starting with 1, 2 and the remainder zeros
int[1000] a = [1, 2, 0..];
More information about the Digitalmars-d
mailing list