So I have a problem to override a pure virtual function in my derived class. The implementation and declaration of the classes looks like this:
class Base{
private:
size_t id;
public:
virtual bool isEqual(const Base& src) const =0;
};
class Derived: public Base{
private:
string str;
public:
virtual bool isEqual(const Derived& src) const override
{
return (this->str == src.str);
}
};
so when I implement it like this it hits me with compiler error like
member function declared with 'override' does not override a base class member function
Could you plz tell me how I could get that right and maybe explain me why my version doesn't work. Thanks in advance!