Code security: "auto" / Reason for errors

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 3 11:40:57 PST 2016


On 3/3/16 2:03 AM, Daniel Kozak via Digitalmars-d wrote:
> Dne 3.3.2016 v 03:39 Jack Stouffer via Digitalmars-d napsal(a):
>>  Dynamic arrays are reference types in D;
> No, they are value types, but mimic reference types in some cases

The case that you pass something by reference, and change what that 
reference is pointing at, is not a special quality of arrays. They are 
most definitely reference types.

What gets people confused is that arrays will change what they reference 
in surprising ways. Appending is one such case. Increasing length is 
another.

-Steve


More information about the Digitalmars-d mailing list