Whitch can replace std::bind/boost::bind ?

Dsby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Mar 18 03:50:34 PDT 2016


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.




More information about the Digitalmars-d-learn mailing list