What happens here is "hiding".
First an example for normal functions:
class A
{
public:
void f(); };
class B: public A
{
public:
void f(int); };
The function at 2 hides the one at 1. You can circumvent this by a
using A::f;
in
B
.
The
operator++
has two signatures: one without an argument and the other with argument. When calling one or the other, you have two options, e.g. for operators as class members:
implicit call | explicit call |
---|
++a; |
a.operator++(); |
a++; |
a.operator++(0); |
The definition in the class is:
class C
{
public:
C& operator++(); C operator++(int); };
So, finally: since the two operators are overloads of each other, you hide in your B class the one from the A class.
Cheers
Andi
PS: The warning says it all ;-). That the compiler decides to take the "wrong" operator is debatable, but the warning tells that it does so.