auto ref is on the docket

Daniel N via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 22 13:42:56 PDT 2015


On Monday, 22 June 2015 at 05:25:57 UTC, Walter Bright wrote:
> The idea is that fun(5) would be lowered to:
>
>    auto tmp = 5;
>    fun(tmp);
>
> But when talking to Andrei I didn't realize that it would be 
> subtly different behavior than 'auto ref' for template 
> functions, which makes me concerned that this is not a good 
> idea.

Considering we already have working 'Sealed references', why not 
simply allow rvalues for plain ref?

Bonus: No risk of mixup with template auto ref after refactoring 
etc.
Save auto for other potential future use.


More information about the Digitalmars-d mailing list