Is the address-of operator (&) really needed?

Paulo Pinto pjmlp at progtools.org
Fri Jun 1 13:27:49 PDT 2012


On Friday, 1 June 2012 at 15:58:04 UTC, Andrej Mitrovic wrote:
> On 5/31/12, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>> 2. Just because ref is often better than a pointer doesn't 
>> mean that it's
>> never valuable to be able to pass a pointer to a variable.
>
> 5. And '&' documents code better at the call site. I personally 
> refuse
> to use out/ref arguments because the call site makes it 
> ambiguous
> whether an argument is passed by reference or not.

As someone which used to breath Turbo Pascal and Delphi, I really 
enjoy the C# and C++ references.

Never got the point with C only developers insisting take the 
address on the call site. This is also one of the features I 
dislike in Go and should be taken by the compiler in the presence 
of ref/var/& parameters.


More information about the Digitalmars-d mailing list