Converting function to delegate - was Re: How to know whether to use function or delegate

BCS BCS at pathlink.com
Tue Jul 25 14:49:29 PDT 2006


Frits van Bommel wrote:
> BCS wrote:
>> Frits van Bommel wrote:
>>> Chris Miller wrote:
>>>> Isn't there an easier way to directly convert a function to a delegate?
>>>
>>> Ehm, how about this:
>>>     mydelegate = { somethingStatic(); };
>>
>> for(int i=0; i<0x100000 i++)
>>     mydelegate();
>>
[...]
>> Making a re-wrap-args and goto stub will save a bunch of time.
> 
> I believe Chris asked for an /easy/ way, not /the most efficient/ way. 

Ah, easy, as in "something simple I can do now, because I need to write 
the program". Not "how can D be changed to make this fast simple and 
elegant?" (e.i. fn->dg cast)

Man, I've /got/ to quit (hypothetically) solving problems by 
(hypothetically) changing D.

=P



More information about the Digitalmars-d mailing list