Function Pointers with Type T
amparacha via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Sep 16 10:35:26 PDT 2014
Thanks its the right help at right time.
On Tuesday, 16 September 2014 at 09:13:38 UTC, evilrat wrote:
> 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