Array Operations and type inference

Don nospam at nospam.com
Sat Aug 7 12:36:11 PDT 2010


Mafi wrote:
> Hey, here Mafi again,
> I thought about your snippets and here's what I have.
> 
> Am 07.08.2010 14:10, schrieb simendsjo:

>> { // Like the previous example, but with dynamic arrays..
>> double[] a = [1,1,1];
>> auto b = a;
>> assert(a is b);
>> b = a[] + 3;
>> assert(a == [1,1,1]);
>> //writeln(b); // access violation. Because of dynamic arrays?
>> }
> I have no idea. Maybe the array generated by the vector addition is kind 
> of temporary and you have to copy. But it could also be a bug.
> Vector-operations are still quite buggy.

That is bug 4578, which has been fixed, and will be in the next compiler 
release.


More information about the Digitalmars-d-learn mailing list