W
wim delvaux
class A {
public :
virtual void a( int x ) = 0;
virtual void a( void ) {
printf( "a without\n" );
}
};
class B : public A {
public :
virtual void a( int x ) { printf( "a with\n" ); }
};
int main( void ) {
B SomeB;
SomeB.a();
SomeB.a( 1 );
}
The error I get with gcc 3.4 is
t.cpp: In function `int main()':
t.cpp:25: error: no matching function for call to `B::a()'
t.cpp:17: error: candidates are: virtual void B::a(int)
What is going on ? Why can't I define two 'a' with different arguments ?
public :
virtual void a( int x ) = 0;
virtual void a( void ) {
printf( "a without\n" );
}
};
class B : public A {
public :
virtual void a( int x ) { printf( "a with\n" ); }
};
int main( void ) {
B SomeB;
SomeB.a();
SomeB.a( 1 );
}
The error I get with gcc 3.4 is
t.cpp: In function `int main()':
t.cpp:25: error: no matching function for call to `B::a()'
t.cpp:17: error: candidates are: virtual void B::a(int)
What is going on ? Why can't I define two 'a' with different arguments ?