Binding rvalues to ref parameters redux

kinke noone at nowhere.com
Fri Mar 29 00:03:24 UTC 2019


On Thursday, 28 March 2019 at 23:46:34 UTC, kinke wrote:
> I'd find that a bit counter-intuitive (or more complex than 
> necessary)

Just to elaborate - that would allow to quickly summarize the 
rules as in:

- If the argument is an lvalue, it binds if the types are an 
exact or qualified match.
- If it's an rvalue, it binds if it's implicitly convertible to 
the param type *and* the argument expression is not assignable 
(writable property, opIndex expression with opIndexAssign 
writability, ...).


More information about the Digitalmars-d mailing list