Let's say I have the following classes:
class A {
public:
virtual void foo() {
bar();
}
protected:
virtual void bar() {
// Do stuff
}
}
class B : public A {
protected:
virtual void bar() {
// Do other stuff
}
}
If I have an instance of B and call the foo method, which bar method would get called? And is this compiler specific?
Thanks