#include <iostream>
struct Base
{
virtual void f(){std::cout << "Base";}
virtual ~Base() = default;
};
struct Derived: Base
{
virtual void f(int){std::cout << "Derived";} // we hide the Base::f()
};
int main()
{
Base* pBase = new Derived;
pBase -> f(); // calls Base::f()
delete pBase;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RydWN0IEJhc2UKewogICAgdmlydHVhbCB2b2lkIGYoKXtzdGQ6OmNvdXQgPDwgIkJhc2UiO30KICAgIHZpcnR1YWwgfkJhc2UoKSA9IGRlZmF1bHQ7Cn07CgpzdHJ1Y3QgRGVyaXZlZDogQmFzZQp7CiAgICB2aXJ0dWFsIHZvaWQgZihpbnQpe3N0ZDo6Y291dCA8PCAiRGVyaXZlZCI7fSAvLyB3ZSBoaWRlIHRoZSBCYXNlOjpmKCkKfTsKCmludCBtYWluKCkKewogICAgQmFzZSogcEJhc2UgPSBuZXcgRGVyaXZlZDsKICAgIHBCYXNlIC0+IGYoKTsgLy8gY2FsbHMgQmFzZTo6ZigpCiAgICBkZWxldGUgcEJhc2U7Cn0=