std ::线程调用类的方法
可能重复:
用成员函数启动线程
我有一个小class:
class Test { public: void runMultiThread(); private: int calculate(int from, int to); }  如何从方法runMultiThread()中的两个线程calculate两个不同的参数集(例如calculate(0,10) , calculate(11,20) runMultiThread() ? 
  PS谢谢,我已经忘记,我需要通过this ,作为参数。 
不那么难:
 #include <thread> void Test::runMultiThread() { std::thread t1(&Test::calculate, this, 0, 10); std::thread t2(&Test::calculate, this, 11, 20); t1.join(); t2.join(); } 
如果仍然需要计算结果,请改用future :
 #include <future> void Test::runMultiThread() { auto f1 = std::async(&Test::calculate, this, 0, 10); auto f2 = std::async(&Test::calculate, this, 11, 20); auto res1 = f1.get(); auto res2 = f2.get(); }