Partially instantiated template as argument to alias parameter.

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 4 15:10:05 PST 2015


On Wednesday, 4 November 2015 at 23:07:42 UTC, Yuxuan Shui wrote:
> I think this is a reasonable use case:
>
> auto A(R, S)(R a,S b) {return a+b;}
>
> auto B(alias f)(){return f(1, 1.0);}
>
> void main{writeln(B!(A!int)());}

Currently this is doable by moving the parameters that are to be 
explicitly instantiated to an outer template:

template A(R)
{
     auto A(S)(R a,S b) {return a+b;}
}



More information about the Digitalmars-d mailing list