I have a base class BaseClass that defines const SomeType & BaseClass::operator >> (SomeType&)const;
I have a child class of BaseClass. Until now, i could use the operator >> of the base class on an object of the child class.
But since i added const OtherType& ChildClass::operator >> (OtherType&)const;
as a member in ChildClass, the compiler doesn't find a candidate for operator >> in the places i use the operator of the base class on an object of the child class.
I can overload an other operator on the child class that just calls the base class method and my problem is solved, but that means i will have to overload a method for each child class of the base class, even though they will have the same code.
Do you have an idea what's the reason for this, and is there a workaround?