#include <iostream>
#include <string>
#include <vector>
using namespace std;
// --- from librarry, can't edits thoes 4 lines below ---
class in1 { public: };
class in2 : public in1 { public: virtual void Show() { } };
class wind : public in2 { public: };
class frame : public wind { public: };
// --- we can edit only below ---
// my extension to wind - adding some handy functions to it
class windExt : public virtual wind { public: virtual void Foo() { } };
// my cutsome frame, that is both an extended window, and a frame
class myFrame : public virtual windExt, public virtual frame {
public:
void Bar() {
Foo();
Show();
}
};
int main() {
myFrame f;
return 0;
}
x.cpp: In member function 'void myFrame::Bar()':
x.cpp:20: error: reference to 'Show' is ambiguous
x.cpp:8: error: candidates are: virtual void in2::Show()
x.cpp:8: error: virtual void in2::Show()
How to fix it?