Read in-depth knowledge of the C + + Kernel Object Model Summary (1/3/4)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.