Code security: "auto" / Reason for errors

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 2 12:07:30 PST 2016


On 2016-03-02 21:01, Ozan wrote:

> I agree for slices, but typically variables should have his own data.
> To add additional code for separate data has a lot of risk in my mind.
> Behaviors should also be the same.
>
> int a = 1:
> int b = a;  // data copy
>
> int[] a;
> int[] b = a; // pointer copy
>
> is not the same and should be avoid.

Same thing for objects which are reference types.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list