Setting them again for each derived class is a waste, since they would be available anyway by inheritance.
为每个派生类再次设置这些属性是一种浪费,因为通过继承它们就会拥有这些属性。
Another use of abstract classes is to create a single base class for multiple derived classes in which that base class should never be instantiated.
抽象类的另一个用途是为多个派生类创建一个基类,在这些派生类中,基类决不会被实例化。
The size of a derived class is the size of the base class plus the additional members defined by a derived instance (and any extra space required for alignment, as discussed earlier).
派生类的大小等于基类加上派生实例定义的其他成员(以及对齐所必需的任何额外空间 — 如前所述)的大小。
应用推荐