On Saturday, 14 November 2020 at 17:21:15 UTC, Marcone wrote:
Error:
D:\dmd2\windows\bin\..\..\src\phobos\std\parallelism.d(516):
Error: struct `Fruit` does not overload ()
I think you need to pass the this pointer somehow. This works:
import std;
struct Fruit {
string name;
static
On Saturday, 14 November 2020 at 17:21:15 UTC, Marcone wrote:
Error:
D:\dmd2\windows\bin\..\..\src\phobos\std\parallelism.d(516):
Error: struct `Fruit` does not overload ()
You can't. Because everything that can run in a new thread must
be a (separate) function. If you are using an object (y
My simple example code:
import std;
struct Fruit {
string name;
this(string name){
this.name = name;
}
void printmyname(){
writeln(this.name);
}
void showname(){
task!this.printmyname().executeInNewThread(); // E