Cannot implicitly convert delegate to function
Lionello Lunesu
lio at lunesu.remove.com
Thu Apr 27 11:30:52 PDT 2006
Jarrett Billingsley wrote:
> "Lionello Lunesu" <lio at lunesu.remove.com> wrote in message
> news:e2qig4$1ovk$1 at digitaldaemon.com...
>> Hi,
>>
>> Shouldn't a (pointer to a) function be convertible to a delegate? Seems to
>> me it's like casting an int to a long; the latter has "more info" and can
>> be converted back into the former without the loss of data. The same holds
>> for function/delegate: a function could be converted to a delegate for
>> "null"; by forgetting the "this" (null), we get the function pointer back.
>
> Without the context pointer, a delegate cannot function properly. So
> casting from delegate to function isn't really possible.
I meant it the int-long way: you can cast an int to a long and back
without loss of data.
L.
More information about the Digitalmars-d-learn
mailing list