The annotated C++ reference manual
The annotated C++ reference manual
Effective C++: 50 specific ways to improve your programs and designs
Effective C++: 50 specific ways to improve your programs and designs
Modula-3
The C++ programming language (2nd ed.)
The C++ programming language (2nd ed.)
C++ programming style
Space and time-efficient memory layout for multiple inheritance
Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Hi-index | 0.00 |
For systems of C++ classes using virtual functions, writing base classes that only specify virtual member functions and then writing other base classes that only implement those functions improves extensibility. When interface is separated from implementation, both interfaces and implementations can be extended separately by derivation. New classes can then be composed by multiple derivation, combining one interface and one implementation base class. We call this form of composition base-class composition. Programmers familiar with the advantages of base-class composition fail to use it because of the performance penalty of multiple derivation and virtual base classes. Consequently, compiler writers, failing to see extensive applications of multiple derivation and virtual bases, have little incentive to eliminate the performance penalty. We highlight the advantages of the base-class composition pattern and show how the performance penalty can be eliminated by compiler optimization.