https://issues.dlang.org/show_bug.cgi?id=12839
--- Comment #1 from John Colvin <[email protected]> --- Interestingly, the following works fine. It should be the same as the lambda-based version, no? import std.parallelism; import std.algorithm; auto loo(int a, int[] b) { auto inner(int c) { return a; } auto wrapper(int x) { auto wrapperInner() { return inner(x); } return &wrapperInner; } return b.map!wrapper; } void main() { defaultPoolThreads = 1; auto res = loo(3, [1,2,3]); auto jobs = taskPool.map!"a()"(res); assert(jobs.front() == 3); } --
