Lars T. Kyllingstad Wrote:

>     // Same as above, using template alias parameter.
>     auto eval(alias f, X)(X x) { return f(x); }
> 
>     // Test
>     void main()
>     {
>         int add2(int i) { return i + 2; }
>         assert (eval!add2(1) == 3);
>     }
> 
> I'd be grateful if people would share their knowledge of the pros and 
> cons of each method.  For instance, are there any situations where 
> template alias parameters don't work?
> 
> 
> Thanks,
> 
> -Lars

Well, with using an alias parameter then std.functional.unaryFun/binaryFun is 
usable so you could use the eval!"a+2"(5) syntax.

Reply via email to