<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 September 2014 03:14, monarch_dodra via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Friday, 12 September 2014 at 16:48:28 UTC, Dmitry Olshansky wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
08-Sep-2014 16:46, Manu via Digitalmars-d пишет:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Please can we move on a solution to this problem?<br>
It's driving me insane. I can't take any more of this! >_<<br>
<br>
Walter invented a solution that was very popular at dconf2013. I don't<br>
recall any problems emerging in post-NG-discussions.<br>
<br>
Ideally, we would move forward on a design for 'scope', like the<br>
promising (imo) proposal that appeared recently. That would solve this<br>
problem, and also many other existing safety problems, and even<br>
influence solutions relating to other critical GC/performance problems.<br>
</blockquote>
<br>
<br>
IMO just legalese auto ref for normal functions and you are all set.<br>
The semantics end up to be pretty much the same as c++ const & does (not duplicating the function, like current template-style auto ref).<br>
</blockquote>
<br></div></div>
Yeah, the whole function duplication thing is pretty bad. Auto ref should just create a wrapper that forwards, and the implementation always operate on references.<br>
<br>
With this approach in mind, auto ref for functions should be trivial, in thé sense that the function is compiled normally as a non template that takes refs, and the compiler only generates code/templates to capture r values.<br>
</blockquote></div><br></div><div class="gmail_extra">Why the hack? Why not just take a local for the rvalue in the scope that it appears?</div><div class="gmail_extra">Generating proxy functions and stuff just makes problems, like taking function pointers of functions, and messes with the debuginfo in very annoying ways. Quality debuginfo is super-important, but D gives it very little attention; we need to move forward on that front, not backwards.</div><div class="gmail_extra"><br></div><div class="gmail_extra">auto-ref is a disaster, please don't make it more pervasive.</div></div>