typedef function<void()> func;
f = std::bind(&Parent::callMe,this);
cout << "parent" << endl;
class Child : public Parent
cout << "child" << endl;
int main ()
The output above is how it behaves in VS2012. This is the behavior I would expect. I desire/expect the below behavior:
- f can legally bound to 'callMe', even in the Parent's ctor
- The function is treated as virtual even when called through the function pointer. So the child class's override is called once Child has been constructed.
My question is... is this standard behavior? Is this how this will work everywhere? Or am I doing something undefined?