[Development] QList
Kuba Ober
kuba at mareimbrium.org
Fri Mar 24 01:42:14 CET 2017
23 mars 2017 kl. 17:22 skrev Thiago Macieira <thiago.macieira at intel.com>:
>
> You're contradicting yourself now. If private inheritance is not is-a, then
> you can't tell me not to use private inheritance because QString isn't a
> QStringView.
>
> I don't want QStringView to appear to users as a base of QString. I just want
> code reuse.
I agree. Public and non-public derivation in C++ have vastly different meaning. Public derivation means is-a in the technical sense of LSP. Non-public derivation is an implementation detail that expresses has-a in a way that allows easier use or re-exposure of the members of the base class. It has to do with semantics of C++ and has zilch to do with OO design.
Cheers, Kuba
More information about the Development
mailing list