Introduced by: C++11
Overriding virtual functions is one of the most important mechanisms of C++ object oriented programming. The derived class method is overriding base class method when following requirements are met:
- the base class method has virtual keyword,
- derived class method has:
- the same name,
- the same input parameters,
- the same const-ness,
- compatible return type.
If at least one of these requirement is not fulfilled, developer can end with not-overriding method and not even know about it. The C++11 standard introduces specifier override, designed for easy detection of such mistakes.
