-
Private inheritance means is-implemented-in-terms of. It's usually inferior to composition, but it makes sense when a derived class needs access to protected base class members or needs to redefine inherited virtual functions.
-
Unlike composition, private inheritance can enable the empty base optimization. This can be important for library developers who strive to minimize object sizes.
转载于:https://www.cnblogs.com/zhtf2014/archive/2011/04/04/2005446.html