delegates vs functions => practical consequences

Steven Schveighoffer schveiguy at yahoo.com
Thu Apr 19 09:47:33 PDT 2012


On Thu, 19 Apr 2012 09:04:47 -0400, Xan <xancorreu at gmail.com> wrote:

> Thank you very much all of you for the information. Now I have an idea  
> of practical benefits and contra-benefits of these.
>
> By the other hand, is there toFunction for passing delegate to function  
> (theorically it's possible, isn't?)

No.  A delegate requires a context pointer.  you *can* extract the actual  
function pointer and context pointer from a delegate, but you can't call  
the function without making a delegate out of it again.

-Steve


More information about the Digitalmars-d-learn mailing list