Objective C ++ Study Notes (Part Four: Item 18-25), effective18-25

Source: Internet
Author: User

Objective C ++ Study Notes (Part Four: Item 18-25), effective18-25
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 necessary to find and use them.

When it comes to criticism:

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

Part 1: Design and Declarations)
This section mainly describes the design principles and rules of classes, as well as some points that should be paid attention to when designing member commands and member functions. I personally feel that it is essential to design a class.


Article 18: Make the interface Easy to use correctly and misuse
Clause 19: design class is like design type
Clause 20: replace pass-by-reference-to-const with pass-by-value.
Clause 21: when an object must be returned, do not think about returning its reference
Clause 22: declare its member variables as private
Cla23: Native replaces the member function with non-member and non-friend.
Clause 24: If all parameters require type transfer, use the non-member function for this purpose.
Clause 25: Write A swap function that does not throw an exception.

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.