Given this code:
class foo
{
public:
foo() : _myFunc( bind( &foo::testCall, this ) ){}
virtual void testCall(){ cout << "foo" << endl; }
void call(){ _myFunc(); }
private:
function< void() > _myFunc;
};
class bar: public foo
{
public:
virtual void testCall(){ cout << "bar" << endl; }
};
void main()
{
bar test;
test.call();
}
Why does it print "bar". I read this issue and would have thought that "foo" would have been printed.