Gives an error indicating boost::thread
non-standard syntax; use "&" to create a pointer to member `
What needs to be fixed? If you specify stupid &readFile , another error will appear
&: invalid operation with bound member function expression
class Service { public: void readFile() {...}; void sum() { for (int i = 0; i < 5; ++i) { threads.push_back(boost::thread(readFile)); } } private: vector<boost::thread> threads; };
readFileis a member function of the class . So at a minimum, you need to specify this fact ... but at most, well, you gave the address - and for what object should it be called? It also has a hidden parameterthis- how doesthreadknow what to pass toreadFile? - Harry