How to be sure a method is overriding an existing virtual one in C++?
Let's suppose we have a base class which has a virtual method: class BaseClass { virtual void MethodToOverride() const { DoSomething(); } }; And a derived class which overrides the method (depending on the situation we can make it again virtual or not): class DerivedClass : public BaseClass { void MethodToOverride() const { DoSomethingElse(); } } If we make a mistake, for example defining the MethodToOverride non const or with a wrong character, we simply define a new method, for example: void MethodToOverride() {} // I forgot the const void MthodToOverride() const {} // I made a typo So this