IFTI - first impressions

Sean Kelly sean at f4.ca
Wed Mar 8 13:15:42 PST 2006


Oskar Linde wrote:
> Hello,
> 
> With the new IFTI support, I just had to do some quick tests. It turns 
> out it works perfectly given its limitations. I had to rewrite some 
> templates to be more IFTI-friendly. One example:
> 
> Before:
> 
> template filter(T:T[]) {
>     T[] filter(T[] arr, bool function func(T)) {
>         ...
>     }
> }
> 
> After:
> 
> template filter(ArrTy, FuncTy) {
>     ArrTy filter(ArrTy arr, FunTy fun) {
>         ...
>     }
> }

This should only be a temporary measure.  Once IFTI matures a bit, your 
original function should work as expected.  In fact, the first form is 
necessary in some cases to make sure the proper overload is called.


Sean



More information about the Digitalmars-d mailing list