Array operations, dynamic arrays and length

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 2 05:21:05 PDT 2015


On Thursday, 2 July 2015 at 10:48:56 UTC, Steven Schveighoffer 
wrote:
> On 7/1/15 8:36 PM, J Miller wrote:
>
>> Oh, and to make things really confusing, "auto e = a[] - b[]" 
>> and "int[]
>> e = a[] - b[]" both cause "Error: array operation a[] - b[] 
>> without
>> destination memory not allowed".
>>
>> Using dmd 2.067.0.
>
> This is not a bug. You need to allocate memory before you can 
> write to it. Automatic allocation doesn't happen in D.

This particular part works as intended, but the other things 
_are_ buggy.


More information about the Digitalmars-d-learn mailing list