Is it possible to call the virtual function foo( int ) from B without using what is done in comment ?
class A {
public:
virtual void foo ( char * ) {
}
virtual void foo ( int ) {
}
};
class B : public A {
public:
void foo ( char * ) {
}
//void foo ( int i ) {
//
// A::foo(i);
//}
};
B b;
b.foo(123); // cannot convert argument 1 from 'int' to 'char *'
virtual void foo(int)on first glance appears to be the body ofvirtual void foo(char *). Compilers may not care about odd formatting, but humans do....foooverloads was introduced by an editor, not by the OP.