We can modify the member function of a class with static, or you can use the const to decorate a member function of a class (written at the end of the function to indicate that the member variable cannot be modified, not the one that represents the return value as a constant). Can you use both static and const to modify the class's Crown function?
No. In order to ensure that the function cannot modify the state of the instance of the class when implementing the Const member function, the C + + compiler adds an implicit parameter, const this*, to the function. However, when a member is static, the function does not have this pointer. This means that static usage and static are conflicting.
The function of static is to indicate that it is only on the static variable of the about, which is not related to the instance of the class, and that the function of const is to ensure that it cannot modify the state of the instance of the class, and that it has no relation to the static variables of the type.
A function in this class is called with a null pointer of a class, but this function does not use the class's member variables, then it can be successful, if the call function uses the class member variable, then it will crash, if the virtual function is called, there will be problems, because the virtual function is accompanied by the instantiation of the resulting. There is no virtual function table without instantiation.
Can a static member function also be a virtual function?
No, call a static member function without an instance. But calling a virtual function requires a pointer to a virtual function table from one instance to get the address of the function, so calling a virtual function requires an instance.
In C + +, member variables are initialized in the same order as they are declared in a variable class, regardless of their order in the constructor's initialization list.
The copy constructor cannot pass the value, only the reference, if it is a value, then in the function of the constructor must use the function itself, this is unreasonable phenomenon.
C + + Fundamentals--static members and const members