I have this piece of code (contrived from my real-life trouble)
It cannot compile, complaining ExtendsB does not implement B::Run(A* a)
. However, it has no
It's simply two different types, which makes it two distinct functions with two distinct signatures.
In general, if you're using a compiler that understands C++11, you should use the override keyword on functions that are intended to override another function. In your case, the error became apparent because of the abstract base class, but in other cases such an error can cause a lot of debugging...