What happends here, and how do i get around it?
Creating a Concrete object my compiler does not resolve theCode:class Base { public: int foo(int, int) { //implemented } virtual int foo(int) = 0; }; class Concrete: public Base { public: virtual int foo(int) { //implemented } };
foo(int,int) method.
I get the following error using VS.net 2003.
I guess i could solve it doing something likeCode:foo' : function does not take 2 arguments
But i think that should not be necessary?Code:class Base { public: virtual int foo(int, int) { //implemented } virtual int foo(int) = 0; }; class Concrete: public Base { public: virtual int foo(int) { //implemented } virtual int foo(int x,int y) { return Base::foo(x,y); } };
Help!![]()



LinkBack URL
About LinkBacks




A function with the same name as a base function, hides the base function--even if it has a different signature. To overload a function, the functions must be declared in the same scope.