Abstract:
Inheritance combined with virtual functions in strongly typed object oriented programming languages,such as C++,provides programmers with much polymorphism.However,it is difficult to enrich each of a family of classes with some common features.Here proposed are the concepts of truly virtual base classes and virtual data members,which can be utilized to solve the problem efficiently,eliminate the conceptual inconsistency between virtual functions and virtual base classes in C++,and consumate the virtuality so as to provide further polymorphism and a type safe and efficient alternative to constrained genericity and multiple inheritance in some cases,thus facilitating the design and implementation of extensible and portable software,especially,that of libraries of classes.