Sting class and standard template library

Source: Internet
Author: User

Nested class:

In C ++, you can place the class declaration in another class. A class declared in another class is called a nested class. It provides a new type Class scope to avoid name confusion.

Nested classes and access permissions:

First, the declared position of the nested Class determines the scope of the nested class, that is, it determines which part of the program can create this type of object. Second, like other classes, the public, protected, and private parts of the nested classes control access to class members.

The position of the class declaration determines the scope or visibility of the class. When the class is visible, the access control rules (public, protected, private, and friends) determine the program's access permissions to the nested class members.

Stack rollback:

Now, if the function is terminated due to an exception (rather than a return), the program also releases the memory in the stack, but does not stop the first return address of the stack, instead, release the stack until a return address located in the try block is found. Then, the control will go to the exception handler at the end of the block, instead of the first statement after the function call. This process is called Stack rollback.

Exception:

The invalid_argument exception indicates that an unexpected value is passed to the function.

Length_error indicates that there is not enough space to perform the required operation.

Exception out_of_bounds is usually used to indicate index errors.

Rtti is short for runtime type identification.

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.