querying for virtual method existence
Hi All,
I've a base class and about 500 derivatives classes. No, i'm not
confusing class instances with class definitions... and don't ask how
we end up having so many classes...
There are few methods which can be eliminated from the whole hierarchy
cone if at run time the base class could "know" if a certain method
was overridden.
Bottom line - i need the code for Foo::wasBarReDefinedNew
your help is well appreciated.
Rabin.
class Foo {
public:
virtual int bar(double, int, char ) ;
virtual bool wasBarReDefined()const=0;
bool wasBarReDefinedNew()const
{ // i need the code here...
return ????
}
};
class Bar1 : public Foo { // about 200 more Bar classes....
public:
virtual bool wasBarReDefined()const{return true;}
virtual int bar(double, int, char );
//....
};
class Baz1 : public Foo { // about 300 more Baz classes....
public: // no override of 'bar'
virtual bool wasBarReDefined()const{return false;}
///....
};
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]