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.