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(); // Error here!! Can not send this.printmyname() tonew thread.
} } void main(){ Fruit f = Fruit("Banana"); f.showname(); }Error: D:\dmd2\windows\bin\..\..\src\phobos\std\parallelism.d(516): Error: struct `Fruit` does not overload ()