`in` parameters made useful

Per Nordlöw per.nordlow at gmail.com
Sat Aug 1 15:22:26 UTC 2020

On Friday, 31 July 2020 at 22:01:06 UTC, Adam D. Ruppe wrote:
> On Friday, 31 July 2020 at 21:49:25 UTC, Mathias LANG wrote:
>> B) It makes `in` take the effect of `ref` when it makes sense.
> i like it
>> D) It allows to pass rvalues to `in`. Because we know it's 
>> `scope`, so it cannot be escaped (allegedly), and it's 
>> `const`, so it cannot be modified, it's only logical that you 
>> can give it rvalues.
> i like this too
> I've argued before the compiler should be allowed to optimize 
> this in `in` case anyway so yeah you have my support here.

I agree. This is the D way. More simplicity via more inference.

Note that brings the meaning of the `in`-parameter-qualifier very 
close (it to equal) to its meaning in Ada.

More information about the Digitalmars-d mailing list