Question about auto ref

Namespace rswhite4 at googlemail.com
Fri Mar 15 08:54:27 PDT 2013


In this thread:
http://forum.dlang.org/thread/mailman.2989.1356370854.5162.digitalmars-d@puremagic.com
Jonathan suggested that auto ref could work for non-template 
functions like this:
All parameters are declared as ref. For possible rvalues, ​​that 
are passed to this function, temporary variables are created.
Furthermore, Andrei said 
(http://forum.dlang.org/thread/mailman.2989.1356370854.5162.digitalmars-d@puremagic.com?page=2#post-kbcc62:24192v:242:40digitalmars.com) 
that this would work and would be very easy to implement.
As it is never happened and was not even suggested in other 
discussions anymore, there must be a reason why this is a bad 
idea.
Can anyone tell me why? Is it because ref is unsafe at this time? 
Or because 'auto ref' would work then different for non-template 
and template functions?


More information about the Digitalmars-d-learn mailing list