The definition of virtual functions follows the following important rules:
1. if a virtual function appears in a base class and a derived class, it only has the same name, and the form parameter is different, or the return type is different, even if the virtual keyword is added, it will not be delayed.
2. Only member functions of a class can be described as virtual functions. Because Virtual functions are only suitable for class objects with inheritance relationships, common functions cannot be described as virtual functions.
3. static member functions cannot be virtual functions, because static member functions are not restricted to an object.
4. the inline function cannot be a virtual function, because the inline function cannot dynamically determine the position during running. Even if the virtual function is defined inside the class, the system still regards it as non-inline during compilation.
5. the constructor cannot be a virtual function, because during the construction, the object is still an undefined space. Only after the construction is complete, the object is an instance of a specific class.
6. destructor can be virtual functions and are generally known as virtual functions.