C++11 allow two new keywords to make clearer to both user/programmer and compiler, if a virtual class method is overriding a virtual base class method (override keyword) or if a non-virtual class method is the final implementation of a virtual base class method (final keyword).
To do:
Add override keyword for all virtual (i.e. not final) derived implementations of virtual base class methods
Add final keyword for all non-virtual (i.e. final) derived implementations of virtual base class methods
Benefit:
more readable and explicit
less error prone (e.g. compiler can check if we are actually overriding a base class method)
C++11 allow two new keywords to make clearer to both user/programmer and compiler, if a virtual class method is overriding a virtual base class method (
override
keyword) or if a non-virtual class method is the final implementation of a virtual base class method (final
keyword).To do:
override
keyword for all virtual (i.e. not final) derived implementations of virtual base class methodsfinal
keyword for all non-virtual (i.e. final) derived implementations of virtual base class methodsBenefit: