c++11 Thread class how to use a class member function

This isn’t the right place for a reference wrapper. A simple pointer suffices, though, and achieves the desired result:

std::thread t1(&A::foo, &a, 100);

Leave a Comment