Class B {
Public:
Virtual void F () const;
};
Class D: Public B {
Public:
Virtual void F ();
};
Here we want to redefine the virtual function B: F, but there is an error. f In B is a const member function, but const is not declared in D. A compiler is like this:
Warning: D: F () hides virtual B: F ()
This compiler tries to tell you that f declared in B is not re-declared in D, but hidden. If you ignore this warning, it will almost certainly lead to incorrect program behavior, followed by many debugging behaviors, just to find out what the compiler has actually detected and told you.
Strive for the honor of "no warning" under the highest warning level of your compiler.
Different compilers have different warning standards. Therefore, you cannot program it rashly and then rely on the compiler to indicate Errors for you.
Before you send a warning, make sure you understand the exact meaning of the intention. This is important.