On Monday, 18 May 2015 at 21:51:49 UTC, Namespace wrote:
Knee-jerk response: if no "return" attribute on a function it should be safe to bind rvalues to ref parameters. Of course that's impractical as a default so explicit "auto ref" would be needed. -- Andrei

Would it be to hasty if someone would start implementing auto ref for non-templates right now? Or should a more experienced user do that? Just in case I can contribute somehow.

I took the liberty to begin with an implementation. Thanks to Kenjiis work, it was not too difficult, I had to adjust only the changes on the new code base:

https://github.com/Dgame/dmd/tree/auto-ref-for-non-templates

Maybe this could be reviewed as soon as 'return ref' is fully implemented.

Reply via email to