More templated type argument inference

bearophile bearophileHUGS at lycos.com
Thu Dec 6 06:05:04 PST 2012


Maxim Fomin:

> The second is template lambda and templates have void type. 
> What you suggest here?

In D template functions become functions if they are passed where 
the D compiler can infer their full type. This is correct code:


void foo(int function(int) f) {}
void main() {
     foo(a => a * a);
}


Bye,
bearophile


More information about the Digitalmars-d-learn mailing list