单继承 多继承
class ImageBook:public Book { } class ImageBook: public Book, public Image { };
virtual inheritance ://li例子如下
class Book :virtual public Paper { };
class Image : virtual public Paper { }
class ImageBook: public Book, public Image { };// 只会出现一个 Paper 几类 ,使用virtual 继承的话
only a single occurrence of the base class is maintained (called a
subobject) regardless of how many times the class is derived from within the inheritance chain