3 ms·
> If classes are types, subsclasses should be subtypes Disagree. C++ added private inheritance for a good reason. There are scenarios when you want to inherit
by naasking 10y ago
> If classes are types, subsclasses should be subtypes
Disagree. C++ added private inheritance for a good reason. There are scenarios when you want to inherit part of an implementation, but override some of the behaviour for code reuse without inheriting any kind of subtyping relationship.
There are also scenarios where you want to declare a subtype without inheriting any parent behaviour.
So ultimately subtyping is distinct from subclassing.