Objective C ++ Study Notes (Part Two: Item 5-12), effective5-12

Source: Internet
Author: User

Objective C ++ Study Notes (Part Two: Item 5-12), effective5-12
Zookeeper

Recently, I finally carefully read javastvie C ++, and I was amazed at the power and charm of C ++. I will keep my recent reading experiences and Reading Notes here recently. It is essential to find and use them. If you sum up any mistakes, please criticize and correct them:

Now, only the framework is listed, and it will be completed as soon as possible:

Part 1: constructor/destructor/value assignment


I personally think this is a difficult part of C ++, and it is also a deep part of C ++. When I first started reading, I may not understand it in some places, the best way is to implement programming while reading and thinking about its essence with your heart!


Clause 5: Understand the functions that C ++ silently writes and calls

Clause 6: if you do not want to use the function automatically generated by the compiler, you should explicitly reject it.
Clause 7: declare virtual destructor for the polymorphism base class
Clause 8: do not escape exceptions from destructor
Clause 9: virtual functions are never called during constructor and destructor.
Clause 10: Make operator = return a reference to * this
Clause 11: handle self-assignment in operator =
Clause 12: Do not forget every component of an object when copying it.

Note: As there are many links between the terms, some of them are not suitable to be pulled out separately. This will be recorded in conjunction with other terms. If you have any questions, please contact us;

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.