Address of parameterless ref function

Cliff Hudson cliff.s.hudson at gmail.com
Sat Apr 9 11:06:31 PDT 2011


Which compiler are you using?  Have you tried a different one?

On Sat, Apr 9, 2011 at 10:55 AM, Andrej Mitrovic <andrej.mitrovich at gmail.com
> wrote:

> Interesting. The problem I think is that the delegate is declared as
> returning int, not ref int. I don't even think we can specify ref as
> the return value of a delegate. But if you try to declare the delegate
> as returning an int*, you get this nice error:
>
> Error: cannot implicitly convert expression (& g) of type int
> function() ref to int* function()
>
> Still, you can't declare the delegate as "int function() ref" or "ref
> int function()". I'm not sure why, or why int* can be implicitly cast
> to int in this case.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110409/b606f34f/attachment.html>


More information about the Digitalmars-d mailing list