Library writing - delegates or fp's?

BCS BCS at pathlink.com
Tue Jul 18 14:50:33 PDT 2006


Andrei Khropov wrote:
> BCS wrote:
>>
>>a while back someone found out that you can take a delegate and replace the
>>internal function pointer with a regular function pointer and it still works
>>just fine. Given this, you could wright a little function*-to-delegate
>>function and let people do this
>>
[...]
>>
>>I known this is an ugly hack, OTOH maybe Walter can be convinced to add a
>>function-pointer to delegate cast that does this in a consistent manner.
>>
>>cast(int delegate(int))&fn
> 
> 
> maybe just "cast(delegate)&fn" in the spirit of inferred typing?
> 
> 

That /would/ be better.



More information about the Digitalmars-d-learn mailing list