How do I pass an instance member function as callback to std::thread [duplicate]
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Start thread with member function I'm VERY new to C++. My experience has mostly been with javascript and java. I'm using Xcode on Lion. The following code gives me a compilation error "Reference to non-static member function must be called; did you mean to call it with no arguments?" class MyClass { private: void handler() { } public: void handleThings() { std::thread myThread(handler); } }; I also tried this-