Sorry, but it is not possible to create a function in a derived class when a function with the same name exists as final in the base class. You will need to rethink your design.
The problem is that declaring a function in a derived class with the same name as the function in the base class is seen as an attempt to override whether the override keyword is present (for historical reasons, I suppose). Therefore, you cannot “disable” the override.
Here's the corresponding standard quote:
§ 10.3 / 4 [class.virtual]
If the virtual function f in some class B marked with the virt final specifier and in the class D derived from B , the function D::f overrides B::f , the program is poorly formed. [Example:
struct B { virtual void f() const final; }; struct D : B { void f() const;
-end
Andyg source share