function ref param vs pointer param

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 24 06:46:41 PDT 2015


On Friday, 24 April 2015 at 13:39:35 UTC, ref2401 wrote:
> processPointer(&ms);
> I think doing this way is more descriptive.
> Now all readers know that ms might be changed inside the 
> function.

C# avoids that problem requiring (in most cases) the usage of 
"ref" at the calling point too. But this idea was refused for D 
(also because it goes against UFCS chains).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list