#include <iostream>
class A {
public:
A() {}
virtual ~A() {}
virtual void runFn() {GetPart(); }
protected:
virtual void GetPart() {
std::cout << "A::GetPart" << std::endl;
}
};
class B : public A {
public:
B() {}
virtual ~B() {}
protected:
virtual void GetPart() override {
A::GetPart();
std::cout << "GETPART RUN" << std::endl;
}
};
int main()
{
B b;
b.runFn();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgQSB7CnB1YmxpYzoKCUEoKSB7fQoJdmlydHVhbCB+QSgpIHt9CgoJdmlydHVhbCB2b2lkIHJ1bkZuKCkge0dldFBhcnQoKTsgfQoKcHJvdGVjdGVkOgoJdmlydHVhbCB2b2lkIEdldFBhcnQoKSB7CgkgICAgc3RkOjpjb3V0IDw8ICJBOjpHZXRQYXJ0IiA8PCBzdGQ6OmVuZGw7Cgl9Cn07CgpjbGFzcyBCIDogcHVibGljIEEgewpwdWJsaWM6CglCKCkge30KCXZpcnR1YWwgfkIoKSB7fQpwcm90ZWN0ZWQ6Cgl2aXJ0dWFsIHZvaWQgR2V0UGFydCgpIG92ZXJyaWRlIHsKCSAgICBBOjpHZXRQYXJ0KCk7CgkgICAgc3RkOjpjb3V0IDw8ICJHRVRQQVJUIFJVTiIgPDwgc3RkOjplbmRsOwoJfQp9OwoKaW50IG1haW4oKQp7CglCIGI7CgliLnJ1bkZuKCk7CglyZXR1cm4gMDsKfQ==