Which compiler are you using?  Have you tried a different one?<br><br><div class="gmail_quote">On Sat, Apr 9, 2011 at 10:55 AM, 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;">Interesting. The problem I think is that the delegate is declared as<br>
returning int, not ref int. I don't even think we can specify ref as<br>
the return value of a delegate. But if you try to declare the delegate<br>
as returning an int*, you get this nice error:<br>
<br>
Error: cannot implicitly convert expression (& g) of type int<br>
function() ref to int* function()<br>
<br>
Still, you can't declare the delegate as "int function() ref" or "ref<br>
int function()". I'm not sure why, or why int* can be implicitly cast<br>
to int in this case.<br>
</blockquote></div><br>