<div class="gmail_quote">On 9 April 2012 04:09, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com">andrej.mitrovich@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 4/9/12, Manu <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote:<br>
</div><div class="im">> I don't follow. Can you give an example that shows this insecurity?<br>
<br>
</div>I mean escaping references to locals:<br>
<br>
ref int xref;<br>
void foo() {<br>
int x;<br>
xref = x;<br>
}<br>
<br>
or<br>
<br>
ref int foo() {<br>
int x;<br>
ref int xref = x;<br>
return xref;<br>
}<br>
<br>
I mean a ref would basically be a pointer with some syntax sugar, no?<br>
It would have the same drawbacks as a pointer.<br>
</blockquote></div><br><div>Nobody returns a ref to a local from a function, and the compiler can easily warn about that.</div><div>Sure, but that's all this was ever meant to be right? alias as a sugar to simplify long expressions... except alias is unsafe too, but in a different and more subtle way.</div>