Cannot implicitly convert delegate to function
Lionello Lunesu
lio at lunesu.remove.com
Thu Apr 27 23:50:14 PDT 2006
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Stewart Gordon schrieb am 2006-04-27:
>> Jarrett Billingsley wrote:
>> <snip>
>>> The other way around.. I don't think so either. Something tells me the
>>> mechanism for a delegate call would screw up if the context pointer were
>>> null, or if the function weren't designed to be a delegate.
>> But why? I can't understand why a function that doesn't touch the
>> context pointer at all can't be trivially be converted to a delegate in
>> which the context pointer is null.
>
> Let's try it:
Great example, Thomas. It works, even if I add some parameters to the
functions, or when I put the static function outside the class.
It seems trivial to let the compiler allow the implicit conversion.
Thanks,
L.
More information about the Digitalmars-d-learn
mailing list