Functors

Craig Black craigblack2 at cox.net
Thu Jun 28 14:08:55 PDT 2007


> if all you want to do is convert fn ptrs to delegates this works:
>
> |T delegate(A) Fn2Dg(T, A...)(T function(A) f)
> |{
> | struct tmp
> | {
> | T ret(A args){ return (cast(T function(A))this)(args); }
> | };
> | return &(cast(tmp*)f).ret;
> |}

I didn't know this was possible.  Are you sure this works? I thought there 
were some issues with calling conventions.

-Craig 




More information about the Digitalmars-d mailing list