You want to override the overloaded function, but the hide rules do not work.
"The hiding rule states that an object in the inner area hides objects with the same name in the outer region."
Please note: it does not matter that it has a different signature, i.e. gogo(int* a)
will hide all gogo(whatever)
functions from the base. Overriding happens only when your functions have the same name, same signatures, and virtual ones (so only gogo(int* a)
will be canceled).
The C ++ FAQ book suggests the use of "non-virtual overloads that cause unloaded virtual machines." (chapter 29.05). Basically you create non-virtual overloaded functions in the base class:
gogo(int a) and gogo(int* a)
which will call virtual functions accordingly:
virtual gogo_i (int a) and virtual gogo_pi (int * a)
And override these virtual machines in the Derived class.
source share