Function Pointers with Type T
evilrat via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Sep 16 02:13:37 PDT 2014
On Tuesday, 16 September 2014 at 01:16:14 UTC, Adam D. Ruppe
wrote:
>
> bool function(T val1,T val2) ptr=&comp!T;
>
>
> Moreover, comp has compile time arguments, so you can't take
> the address of it without forwarding the arguments. So instead
> of &comp, you use &comp!T - passing the T from the outside to
> the comparison function too.
i wish i knew that back when i needed it, so i could avoid
spaghetti mess and not abandon my code :(
More information about the Digitalmars-d-learn
mailing list