<div dir="ltr">On 10 May 2013 06:07, Rob T <span dir="ltr"><<a href="mailto:alanb@ucora.com" target="_blank">alanb@ucora.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><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 Thursday, 9 May 2013 at 19:43:25 UTC, Andrei Alexandrescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 5/9/13 3:39 PM, Rob T wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, if I understand correctly, auto ref for templates will end up doing<br>
exactly the same thing as auto ref for non-template functions? That<br>
would be perfect, otherwise it'll be terribly confusing.<br>
</blockquote>
<br>
There would be clear restrictions on non-template functions, e.g. a non-template cannot return auto ref.<br>
<br>
Andrei<br>
</blockquote>
<br></div></div>
OK I can understand that auto ref on return for a template function is something different, so disallowing auto ref on a regular function makes perfect sense to me.<br></blockquote><div><br></div><div style>It doesn't make sense though. You're creating an arbitrary restriction because overloading an existing meaning doesn't apply (actually conflicts) in this case.</div>
<div style>auto is a template concept, it should not be applied here.</div><div style><br></div><div style>Refer to all the reasoning behind scope ref instead...</div><div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

You can also create template functions with auto ref params that behave exactly like a non-template counter part by not specifying ref on the return, so it seems consistent and a sound solution from that perspective.<br>
</blockquote><div><br></div><div style>Umm, what if the non-template counterpart returns ref? Then it doesn't behave the same.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

D is a complex language, so stuff like this does take some getting used to, but it is very powerful and flexible, no two ways around it.<br></blockquote><div><br></div><div style>If this takes 'getting used to', you're basically admitting that it doesn't make intuitive sense.</div>
</div></div></div>