// For exercise. // We override one of the overloads in class B. // Is the other - vf(double) - inherited? #include #include using namespace std; class A { private: double a; public: virtual void vf(double d){ // Virtual vf(double) cout << "virtual vf(double) in A: " << d << endl; } virtual void vf(){ // Virtual vf() cout << "virtual vf() in A" << endl; } }; class B : public A { private: double b; public: void vf() override { // Virtual vf() overrides A::virtual vf() cout << "virtual vf() in B" << endl; } // It is expected that A::vf(double) is inherited. // BUT THERE ARE PROBLEMS - COMPILER ERROR. }; int main(){ B *b = new B(); b->vf(); b->vf(5.0); // Compiler error: no matching function for call to B::vf(double) }