Cannot use local lambda as parameter to non-global template

Nordlöw per.nordlow at gmail.com
Mon Jan 15 13:55:57 UTC 2018


Why do I get errors like

template instance remove!((_) => _ == 1) cannot use local 
'__lambda5' as parameter to non-global template remove()(in K key)

for

     x.remove!(_ => _ == 1);

but not for

     x.remove!"a == 11";

?

How are these two lambdas different?

The function `remove` is a templated member of a struct instance 
`x`.


More information about the Digitalmars-d-learn mailing list