Error running concurrent process and storing results in array
drug
drug2004 at bk.ru
Wed May 6 03:42:35 UTC 2020
06.05.2020 06:25, data pulverizer пишет:
>
> ```
> onlineapp.d(14): Error: template std.concurrency.spawn cannot deduce
> function from argument types !()(void delegate(double x, double y, long
> i, shared(double[]) z) pure nothrow @nogc @safe, double, double, long,
> shared(double[])), candidates are:
> /dlang/dmd/linux/bin64/../../src/phobos/std/concurrency.d(460):
> spawn(F, T...)(F fn, T args)
> with F = void delegate(double, double, long, shared(double[])) pure
> nothrow @nogc @safe,
> T = (double, double, long, shared(double[]))
> must satisfy the following constraint:
> isSpawnable!(F, T)
> ```
>
I think the problem is in `process` attributes (error message you posted
is strange, is it the full message?)
Make your `process` function a template one to let the compiler to
deduce its attributes. Or set them manually.
More information about the Digitalmars-d-learn
mailing list