Взгляните на boost::bind
.
class Class
{
public:
void method(const char*);
};
// instance is an instance of Class
boost::thread(boost::bind(&Class::method, &instance, "hello main thread"));
Должен это сделать.
Однако обратите внимание, что boost::thread
имеет конструктор, который уже делает это: см. thisссылка .
Таким образом, вы можете просто сделать:
boost::thread(&Class::method, &instance, "hello main thread");