need `this` on trying to use class method with parallelism Task! or task!
Alexey
animuspexus at protonmail.com
Sun Nov 14 12:04:52 UTC 2021
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: tuple `Args` is used as a type
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(533): Error: tuple `Args` is used as a type
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../druntime/import/core/internal/traits.d(191): Error: template instance `pred!(this)` does not match template declaration `isAssignable(Lhs, Rhs = Lhs)`
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/meta.d(842): Error: template instance `t.TC.threadCreator.allSat!(isAssignable, this)` error instantiating
/home/animuspexus/dlang/d_v2.098.0/dmd/generated/linux/release/64/../../../../../phobos/std/parallelism.d(541): instantiated from here: `allSatisfy!(isAssignable, this)`
./t.d(22): instantiated from here: `Task!(threadFunc,
this)`
```
More information about the Digitalmars-d-learn
mailing list