Is DMD 0.166 RC 1.0?
xs0
xs0 at xs0.com
Mon Sep 4 03:36:58 PDT 2006
Ivan Senji wrote:
> xs0 wrote:
>> Would you care for any
>> language that (regardless of other features) made you type "return
>> a+b" like this:
>>
>> accumulator foo;
>> foo.add(a);
>> foo.add(b);
>> return foo.result;
>>
>> Now, consider the remarkable similarity between that case and "auto
>> foo = new int[3][4][5]" versus
>
> Actually this works. But foo cannot be initialized with an initializer.
OK, that particular statement might work, but it doesn't do what you expect:
int[][][] foo = new int[3][4][5];
results in
arr.d(4): cannot implicitly convert expression (new int[3][4][](5)) of
type int[3][4][] to int[][][]
and more importantly, this doesn't work:
int a=3, b=4, c=5;
auto foo = new int[a][b][c];
produces
arr.d(5): Integer constant expression expected instead of a
arr.d(5): Integer constant expression expected instead of a
arr.d(5): Integer constant expression expected instead of b
arr.d(5): Integer constant expression expected instead of b
xs0
More information about the Digitalmars-d-announce
mailing list