【发布时间】:2010-09-27 07:50:43
【问题描述】:
在 C++ 中,我想不出我想从 基类:
class Base;
class Derived1 : private Base;
class Derived2 : protected Base;
真的有用吗?
【问题讨论】:
-
考虑一下:圆是椭圆但Circle is not substitutable for Ellipse,公共继承不是是is-a关系,虽然我们经常称它为所以。
-
圆确实是一个椭圆。不明白你的意思?
标签: c++ inheritance private protected c++-faq