abstract base classes, multiple inheritence, and common pure virtual methods
问题 The following test code seems to indicate that if a class has two abstract base classes with common pure virtual methods, then these methods are "shared" in the derived class. #include <iostream> #include <string> using namespace std; struct A { virtual string do_a() const = 0; virtual void set_foo(int x) = 0; virtual int get_foo() const = 0; virtual ~A() {} }; struct B { virtual string do_b() const = 0; virtual void set_foo(int x) = 0; virtual int get_foo() const = 0; virtual ~B() {} };