The liabilities of binding rvalues to ref

Timon Gehr timon.gehr at gmx.ch
Sun May 5 05:13:15 PDT 2013


On 05/05/2013 01:55 PM, Timon Gehr wrote:
> ...It would be an error to have
> different behaviour of the two "copies". This would mean that in
> non-templated functions, it should be an error to rely on whether or not
> the passed argument was an lvalue. i.e. (auto) ref return of an auto ref
> argument (at least in @safe code) and __traits(isRef,autoRefArgument)
> should be disallowed. ...

It also would need to be an error to have local static variables.


More information about the Digitalmars-d mailing list