Paul Wakefield(deleted)
|
C++ Overloaded method inheritance question.
|
Paul Wakefield(deleted)
05/21/2008 8:47 AM
post8299
|
C++ Overloaded method inheritance question.
Hi,
Im am unable to get the following to compile. It errors in main on the first Call function. Does a derived class hide
methods of the same name with a different sig? I dont want to have to use Base1::Call...
Without going into too much detail I need to be able to build up a class, this is done with template and template
specialisations, with an overloaded function that is then called in the mannor below.
class Base1 {
public:
void Call(){}
};
class Base2 : public Base1 {
public:
void Call(int i){}
};
int main(int argc, char **argv){
Base2 func;
func.Call();
func.Call(5);
return 0;
}
..\src\main.cpp:15: error: no matching function for call to `Base2::Call()'
..\src\main.cpp:9: note: candidates are: void Base2::Call(int)
Is there a way to get this to work?
Kind Regards,
Paul
|
|
|