Укажите operator()
член функции.
РЕДАКТИРОВАТЬ : как ...
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <iostream>
struct MyThread
{
int x;
MyThread(): x( -1 ) {}
void run() // Name doesn't matter.
{
x = 42;
}
};
int main()
{
namespace b = boost;
using namespace std;
MyThread t;
b::thread_group g;
g.create_thread( b::bind( &MyThread::run, &t ) ) ;
// ... whatever
g.join_all();
cout << t.x << endl;
}
Отказ от ответственности: Я не знаком с темами Boost.И этот пример добавлен после того, как ответ принят.