Suppose I have:
class Base
{
public:
void operator()()
{
this->run();
}
virtual void run () {}
}
class Derived : public Base
{
public:
virtual void run ()
{
// Will this be called when the boost::thread runs?
}
}
int main()
{
Base * b = new Derived();
boost::thread t(*b); // <-- which "run()" function will be called - Base or Derived?
t.join();
delete b;
}
From my tests, I cannot get Derived::run()
to be called. Am I doing something wrong, or is this impossible?