D - Delegate restrictions
- Matt Green (10/10) Dec 02 2003 I notice on the delegates page of the D site it reads:
- Julio César Carrascal Urquijo (6/16) Dec 02 2003 Yes, you have to choose. Walter is working on unifying function and dele...
I notice on the delegates page of the D site it reads: "Delegates cannot be initialized with static member functions or non-member functions." Why is this? Does this mean I have to choose between them in my code? I'd hate to be the one to make the choice whether a particular callback works with only methods or only free functions. I can see that delegates not supposed to replace function pointers, but there needs to be a way to accept either a function pointer or a delegate. Regards, Matt
Dec 02 2003
Yes, you have to choose. Walter is working on unifying function and delegate syntax but for now you have to use either function() or delegate() "Matt Green" <matt somewhere.net> wrote in message news:bqj5f0$90m$1 digitaldaemon.com...I notice on the delegates page of the D site it reads: "Delegates cannot be initialized with static member functions ornon-memberfunctions." Why is this? Does this mean I have to choose between them in my code? I'd hate to be the one to make the choice whether a particular callback works with only methods or only free functions. I can see that delegates not supposed to replace function pointers, but there needs to be a way toaccepteither a function pointer or a delegate. Regards, Matt
Dec 02 2003