I think 'scope ref' should always pass the address of given argument to the
function body. Because 'ref' always means "pass the address of given
argument". So, if given argument is an rvalue, compiler will allocate a
temporary on stack, save the rvalue in it, and take its address. If
argument is an lvalue, take its address directly. It should be always true,
eve if the parameter type is small int.

Essentially language semantics should not reflect low level implementation
detail. After DIP36 is accepted, we will get a full set of tools for
efficiency - T, ref T, and scope ref T. From the toolbox, you can choose
the most efficient storage class based on the T.

void foo(MostEfficientParameters!(int, string, S, int[1024]) params) { ... }

Kenji Hara

2013/4/11 Dicebot <[email protected]>

> On Wednesday, 10 April 2013 at 07:43:57 UTC, Dicebot wrote:
>
>> ...
>>
>
> Kenji, got any comments/objections on this point of view? It is not that
> late to change it back ;)
>

Reply via email to