How about Go's &Struct instead of new?

xx xx at xx.com
Thu Nov 12 17:32:47 PST 2009


> In Go (from what I understand), a struct is stack allocated with
>    x := Struct();
> and heap allocated with
>    x := &Struct();

It's a nice trick, but I don't find it intuitive. Getting address of an object (re)allocates it? Literal that has different address each time?



More information about the Digitalmars-d mailing list