I have heard that this book is good, if you want to learn more about C + + can see, this book is the advanced stage reference, the author himself read the book 第一、三、四 chapters, will continue to follow.
The first chapter introduces the introduction of the object model of C + +, the comparison of various models and the models used in C + +, such as Simple object model, table driven object model, C + +, which is used for simple and reference table driving both existing object and virtual function deposit table. There is a doubt that the member function is not where the object is placed? It should be in the compile phase by the compiler to convert the external functions in the global zone similar to the C function, generally is the code snippet, when used by the dynamic loading more reference compilers. The following is the C + + object Model OO idea, although the C + + virtualization mechanism increases the cost of space, but for C + + enhanced Extensibility.
The third chapter is about the data semantics, the size of the data occupied by the class object. 1. The empty class occupies one byte, because the class is distinguished, the class is positioned, and the class is instantiated. 2. Static data is not in the global size of the object. 3. The virtual table has a pointer size. 4. The alignment principle. The maximum alignment principle. 5. Storage Order C + + standards are not specified and are generally stored in the order in which they are declared.
The fourth chapter is about the function object model. This is mainly about the class function declaration definition, the focus is the virtual function, the others do not speak first. Virtual function's Inheritance virtual table problem is divided into single inheritance, multiple inheritance, virtual inheritance. The layout of the virtual table is analyzed here, and the single-inheritance subclass and the base class share a virtual table, and the inheriting subclass and the first inherited class share a virtual table, and the virtual inheriting subclass does not share the virtual table of the parent class.
First of all nonsense to this, a simple summary, speak less, this is the author himself encountered some problems, summary is not very full, the opportunity to revise later. Share!
Read in-depth knowledge of the C + + Kernel Object Model Summary (1/3/4)