Hi,

I'm a developer coming from C and I've a question about class instance as method or function parameter. In the book "The D Programming Language", I read the instance was passed by reference to functions (in the opposite of structures). I understood that it was the same object in the function and the caller. But I'm think, I was wrong because when I print the addresses of an object before the function call and inside the function, they're not the same but the changes from the function are kept in the instance. If I use the "ref" qualifier in the function declaration, the 2 addresses are the same.

How do the changes work in the function? Is there a copy ? Or a "magic" trick :) ?

Chris

Reply via email to