I cannot figure out why the following is happening. Maybe someone can inform me and hopefully point out a way around it.
I have a base class, call it Indexed, and a derived class, call it A. Indexed has a function GetIndex(), and A has a static function GetIndex(char * s). The static function of A causes the inherited function GetIndex() to not be recognized even though the two have different arguments.
1 2 3 4 5 6 7 8 9
class Indexed {
public:
int GetIndex();
};
class A : public Indexed {
public:
staticint GetIndex(char * c);
};
I get the following error:
1 2
error: no matching function for call to 'A::GetIndex()'
note: candidates are: staticint A::GetIndex(char*)
I call both A::GetIndex() and A::GetIndex(str) in the code. But the compiler no longer recognizes the call the A::GetIndex() once static int A::GetIndex(str) is defined.