<div class="gmail_quote">On 4 May 2012 18:55, Jakob Ovrum <span dir="ltr"><<a href="mailto:jakobovrum@gmail.com" target="_blank">jakobovrum@gmail.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="im">On Friday, 4 May 2012 at 15:49:03 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It's very counter intuitive to mark the _function_ ref, rather than it's<br>
return type.<br>
</blockquote>
<br></div>
It is a function attribute, so it makes perfect sense. The rest is an issue of documentation/education.<br>
<br>
I agree it may not be optimally intuitive, but I don't see any superior syntactic options.<br>
</blockquote></div><br><div>Well, I personally see no reason not to allow 'ref' variables anywhere, just like in C++. Breaking out pointers in D feels a bit dirty, by the same reasoning that you use C++ references.</div>
<div>Why not make it a type modifier? It would just be a guaranteed initialised pointer like in C++, and with no pointer assignment semantics.</div>