C++ multiple inheritance with base classes deriving from the same class
问题 I have stumbled on a problem while trying to re-use code from different classes. I post it here in hope that some of you might be able to help me. I have a set of classes (B,C) deriving from the same class (A) which forces the implementation of some methods (foo, run). Class B implements these method, and both B and C provide other methods: #include<iostream> template<class I, class O> class A { public: A() {} virtual ~A() {} virtual void foo() const = 0; // force implementation of this