Copy instead of reference?

Artur Skawina art.08.09 at gmail.com
Thu May 23 04:48:01 PDT 2013


On 05/23/13 13:34, Namespace wrote:
>     A a = b.getA();
> Postblit, no opAssign call.
> 

You're constructing, not assigning. Try reassigning 'a' to see
opAssign in action. It's a bit unintuitive and easy to miss - 
which I did too, hence my misleading first reply - sorry.

The issue is that D has no ref vars, so you can't really keep the
returned refs around, other than passing them to another func.

artur


More information about the Digitalmars-d-learn mailing list