Overloading virtual functions of the same name from different base classes. Is it possible? [duplicate]
问题 This question already has answers here : C++ virtual override functions with same name (4 answers) Closed 6 years ago . The title is probably confusing. Suppose we have the following set up; class A { public: virtual void fn() = 0; }; class B { public: virtual int fn() {}; }; class C: public A, public B { }; Is there any way to define A::fn in class C ? 回答1: No . This is not possible. It will always conflict with either of the fn() . The syntax of fn() are different, void fn(); // in A and in