The function is declared const
in the derived classes, but not in the base class. This means that the derived classes don't override the function; they just declare a different function with the same name.
Either add const
in the base class, or remove it in the derived classes.