auto ref and non-templated functions

Peter Alexander peter.alexander.au at gmail.com
Tue Dec 25 06:17:59 PST 2012


On Tuesday, 25 December 2012 at 14:11:14 UTC, Andrei Alexandrescu 
wrote:
> On 12/25/12 5:36 AM, Jonathan M Davis wrote:
>> However, creating only one version of the function which takes 
>> all refs and
>> specifcally creating variables underneath the hood for any 
>> rvalues so that
>> they can be passed to the function still seems like it could 
>> work.
>
> Yes, that does work and is easy to implement.

Is there any reason this hasn't been implemented? And why aren't 
template auto ref functions implemented like that? It would be a 
bit of a shame if auto ref in template functions works 
differently to auto ref in non-template function.


More information about the Digitalmars-d mailing list