Multiple inheritance example in C++