Say if I have an interface with virtual methods, but one of the arguments are:
virtual void Delete(ParentClass *parentClass) = 0;
If I later implement this in child class
void Delete(ChildClass *childClass)
{
};
…why doesn’t this work as an implementation?
As the function prototype differs (one uses
ParentClassand the otherChildClass) they are not the same functions. Instead the one with theChildClassargument is overloading and not overriding theDeletefunction.