Should out/ref parameters require the caller to specify out/ref like in C#?

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Mon May 29 01:27:59 PDT 2017


Nicholas Wilson wrote:

> On Sunday, 28 May 2017 at 17:54:30 UTC, WebFreak001 wrote:
>> Imagine you wrote a function
>>
>> void foo(ref int a) {
>>   if (std.random.uniform(0, 10) == 0)
>>     a = 0;
>>   // Actual code doing something
>> }
>>
>> [...]
>
> It seems nice in theory but how will it interact with generic code?
> Perhaps it should be optional and purely documentative.

exactly like "&" does.


More information about the Digitalmars-d mailing list