On Sunday, 14 November 2021 at 16:55:24 UTC, Alexey wrote:
Remove "!"
On Sunday, 14 November 2021 at 17:42:18 UTC, Imperatorn wrote:
Try task(&threadFunc) instead of task!(&threadFunc)
worked! huge thanks!
On Sunday, 14 November 2021 at 16:55:24 UTC, Alexey wrote:
On Sunday, 14 November 2021 at 16:40:58 UTC, Andrey Zherikov
wrote:
Just do `auto t1 = task(&threadFunc)` in `threadCreator` then.
Error: value of `this` is not known at compile time
```D
import std.stdio;
import std.parallelism;
cl
On Sunday, 14 November 2021 at 16:40:58 UTC, Andrey Zherikov
wrote:
Just do `auto t1 = task(&threadFunc)` in `threadCreator` then.
Error: value of `this` is not known at compile time
```D
import std.stdio;
import std.parallelism;
class TC
{
void threadFunc()
{
import core.thr
On Sunday, 14 November 2021 at 14:41:21 UTC, Alexey wrote:
On Sunday, 14 November 2021 at 14:24:00 UTC, Andrey Zherikov
wrote:
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
You just need two changes:
- make `threadFunc` function static: `static void threadFunc()`
- use `task` in
On Sunday, 14 November 2021 at 14:24:00 UTC, Andrey Zherikov
wrote:
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
You just need two changes:
- make `threadFunc` function static: `static void threadFunc()`
- use `task` instead of `Task`: `auto t1 = task!threadFunc;`
I need `this
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
You just need two changes:
- make `threadFunc` function static: `static void threadFunc()`
- use `task` instead of `Task`: `auto t1 = task!threadFunc;`
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(436):
Error: need `this` for `threadFunc` of type `void()`
Go example for contrast. Ideally, I'd like something similar;
```Go
p
On Sunday, 14 November 2021 at 12:01:36 UTC, Alexey wrote:
auto t1 = Task!threadFunc;
if this line rewritten as `auto t1 = Task!(TC.threadFunc, this);`
```text
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(451):
Error
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(436):
Error: need `this` for `threadFunc` of type `void()`
./t.d(22): Error: template instance
`std.parallelism.Task!(threadFunc)` error instantiating
thou documentation says `a function
10 matches
Mail list logo