S
shaun roe
Sorry the subject line isnt more explanatory, difficult to be succinct:
I have a base class to a bunch of classes which fill a data structure
and return that data structure, in each case the 'filling' method can
have Either the signature of
bool fillData();
OR
bool fillData(int &i, list<string> & changeParams);
Is it possible to make a baseclass which will enforce that the derived
classes have one or other of these functions? so far my baseclass has
virtual bool fillData(){}
virtual bool fillData(int &i, list<string> & changeParams){}
i.e. a default 'do nothing' implementation for both, which doesnt
enforce anything.
cheers
shaun
I have a base class to a bunch of classes which fill a data structure
and return that data structure, in each case the 'filling' method can
have Either the signature of
bool fillData();
OR
bool fillData(int &i, list<string> & changeParams);
Is it possible to make a baseclass which will enforce that the derived
classes have one or other of these functions? so far my baseclass has
virtual bool fillData(){}
virtual bool fillData(int &i, list<string> & changeParams){}
i.e. a default 'do nothing' implementation for both, which doesnt
enforce anything.
cheers
shaun