I would like to create a task that executes a member function of a struct or class:
import std.parallelism, std.stdio;
struct S {
void foo() {
writeln("S.foo()");
}
}
void main() {
S s;
auto pool = new TaskPool();
auto t = task!(s.foo)(); // error
pool.put(t);
pool.finish();
}
How can I achieve this? I also tried using delegates to no avail.
edit: I found a potentially related question here.