2 ms·
Thanks for the info. I'm not sure if it's supporting my point, refuting it, or is an aside :) > Also, C++ doesn't distinguish between interfaces and classes; a
by chriswarbo 9y ago
Thanks for the info. I'm not sure if it's supporting my point, refuting it, or is an aside :)
> Also, C++ doesn't distinguish between interfaces and classes; an interface in C++ is just a class with no data members.
This doesn't invalidate the point about polymorphism being orthogonal to inheritance. The point is that we can choose whether or not to use inheritance: `breathe` could be implemented in `Mammal` and get inherited by `Dog` and `Dolphin`, or Dog and Dolphin could implement `breathe` themselves and there would be no inheritance. Either way, we still have (subclass) polymorphism, so saying "polymorphism should mean inheritance" seems like a bad idea.