Hi,
is the following piece of code correct or am I doing something stupid?
I´ve got two compiler warnings:Code:struct A {}; struct B {}; struct C {}; struct Interface { virtual ~Interface() { } virtual void func( const A& Obj ) = 0; virtual void func( const B& Obj ) = 0; virtual void func( const C& Obj ) = 0; }; struct Default : Interface { virtual ~Default() { } void func( const A& Obj ) {} void func( const B& Obj ) {} void func( const C& Obj ) {} }; struct Special : Default { // bring all func methods of Default into scope using Default::func; // specialize on A void func( const A& Obj ) { } };
(1) Special::func( const A& ) hides virtual function Default::func( const B& Obj )
(2) Special::func( const A& ) hides virtual function Default::func( const C& Obj )
Is my compiler correct? From my understanding I´m telling it I want all func methods from the bases class to be available in Special.


Reply With Quote

Bookmarks