auto ref and non-templated functions

jerro a at a.com
Wed Jan 2 04:08:15 PST 2013


> "Can we simply make it so that the compiler automatically 
> creates a variable when you pass an rvalue to a non-templated 
> auto ref function?"
>
> So non-template auto ref parameters are just like ref 
> parameters, except they will automatically convert rvalues to 
> lvalues on call by creating a local variable. Normal ref 
> parameters will still need lvalues.

I made a pull requests that implements this:

https://github.com/D-Programming-Language/dmd/pull/1428

I don't have a good knowledge of the DMD cod base, so there could 
be some problems with this that I am not aware of, but it does 
seem to work.


More information about the Digitalmars-d mailing list