
12 Mar
2009
12 Mar
'09
4:09 p.m.
AMDG Filip Klasson wrote:
class MyClass { public: hello(); myFunction(); };
"myClass.cpp" MyClass::hello() { std::cout << "Hello world, I'm a thread!" << std::endl; }
MyClass::myFunction() { boost::thread thrd(&hello); thrd.join(); }
This does not work and i get the compile error: '&' : illegal operation on bound member function expressio
Since hello is a member function, you need to pass this boost::thread thrd(&MyClass::hello, this); In Christ, Steven Watanabe