On Friday, 18 March 2016 at 10:50:34 UTC, Dsby wrote:

foreach (i ; 0..4) {
        auto th = new Thread(delegate(){listRun(i);});//this is erro
        _thread[i]= th;
        th.start();
}

void listRun(int i)
{
writeln("i = ", i); // the value is not(0,1,2,3), it all is 2.
}


I want to know how to use it like std::bind.

This is a bug in the compiler:
https://issues.dlang.org/show_bug.cgi?id=2043

Reply via email to