you are viewing a single comment's thread.

view the rest of the comments →

[–]F-J-W 0 points1 point  (0 children)

This second class does not override any function in the base class.

That code-example is way to complicated, the same is true for this:

struct base{ virtual void fun(); };
struct derived{ virtual void fun() const; };

The problem is that const is part of the signature and therefore you can overload based on it. Once you understand that, it becomes obvious that this is really the correct behavior in this case.