On 01/05/2013 04:58 AM, js.mdnq wrote: > S s = S(2); foo(s) <==> foo(S(2))
For those to be equivalent, there must be a scope around the first one:
{ S s = S(2); foo(s); } <==> foo(S(2))
I think that's what you've been proposing: The compiler could generate a
variable on the stack to be passed to the function that takes ref.
It would still have the problem of losing potential modifications to the variable, which both C++ and D try to protect the programmer from.
Ali
