Cannot use local lambda as parameter to non-global template
Nordlöw
per.nordlow at gmail.com
Mon Jan 15 17:24:32 UTC 2018
On Monday, 15 January 2018 at 15:27:23 UTC, Meta wrote:
> void main()
> {
> auto arr = [1, 2, 3];
> arr.remove!(_ => _ == 1);
> writeln(arr);
> }
>
> Or was that code meant as an example?
The problem occurs when the templated function is a member of the
struct `arr`. I've moved the algorithm into a free function here
https://github.com/nordlow/phobos-next/blob/master/src/hashmap_or_hashset.d#L1190
instead. I've changed the name to `removeAllMatching` for now.
More information about the Digitalmars-d-learn
mailing list