Disappointing inflexibility of argument passing in D

Carl Sturtivant sturtivant at gmail.com
Tue Feb 11 16:57:22 PST 2014


>
> In the meanwhile maybe you can try a workaround with templates? 
> Something like:
>
> void f(D1, D2)(D1 d, D2 d2) if (is(D1:Data) && is(D2 : Data2))
> {
>    // Temp vars and assignment
>    ...
>    ...
>    f(tmpD1, tmpD2);
> }

Yes, that does the job.


More information about the Digitalmars-d mailing list