标签:title cto derived nal line ber rsa actual rect
Initialization order
The order of member initializers in the list is irrelevant: the actual order of initialization is as follows:
1) If the constructor is for the most-derived class, virtual bases are initialized in the order in which they appear in depth-first left-to-right traversal of the base class declarations (left-to-right refers to the appearance in base-specifier lists)
2) Then, direct bases are initialized in left-to-right order as they appear in this class‘s base-specifier list
3) Then, non-static data member are initialized in order of declaration in the class definition.
4) Finally, the body of the constructor is executed
(Note: if initialization order was controlled by the appearance in the member initializer lists of different constructors, then the destructor wouldn‘t be able to ensure that the order of destruction is the reverse of the order of construction)
类的编译顺序
标签:title cto derived nal line ber rsa actual rect
原文地址:https://www.cnblogs.com/wildricky/p/14833229.html