#include <iostream>
class A {
public :
A( ) { }
virtual ~A( ) { }
virtual void runFn( ) { GetPart( ) ; }
private :
virtual void GetPart( ) = 0 ;
} ;
class B : public A {
public :
B( ) { }
virtual ~B( ) { }
private :
virtual void GetPart( ) override {
// This line would not compile
A:: GetPart ( ) ;
std:: cout << "GETPART RUN" << std:: endl ;
}
} ;
int main( )
{
B b;
b.runFn ( ) ;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgQSB7CnB1YmxpYzoKCUEoKSB7fQoJdmlydHVhbCB+QSgpIHt9CgoJdmlydHVhbCB2b2lkIHJ1bkZuKCkge0dldFBhcnQoKTsgfQoKcHJpdmF0ZToKCXZpcnR1YWwgdm9pZCBHZXRQYXJ0KCkgPSAwOwp9OwoKY2xhc3MgQiA6IHB1YmxpYyBBIHsKcHVibGljOgoJQigpIHt9Cgl2aXJ0dWFsIH5CKCkge30KcHJpdmF0ZToKCXZpcnR1YWwgdm9pZCBHZXRQYXJ0KCkgb3ZlcnJpZGUgewoJICAgIC8vIFRoaXMgbGluZSB3b3VsZCBub3QgY29tcGlsZQoJICAgIEE6OkdldFBhcnQoKTsKCSAgICBzdGQ6OmNvdXQgPDwgIkdFVFBBUlQgUlVOIiA8PCBzdGQ6OmVuZGw7Cgl9Cn07CgppbnQgbWFpbigpCnsKCUIgYjsKCWIucnVuRm4oKTsKCXJldHVybiAwOwp9