How to implement a static function in an abstract class?? Where do I implement this?
class Item{
public:
//
// Enable (or disable) debug descriptions. When enabled, the String produced
// by descrip() includes the minimum width and maximum weight of the Item.
// Initially, debugging is disabled.
static enableDebug(bool);
};
First of all, that function needs a return type. I’ll assume it’s supposed to be
void.You implement it in a source file, just as you would implement any other method:
There’s nothing special about it being static or the
Itemclass being abstract. The only difference is that you do not have access to athispointer (and consequently also not to member variables) within the method.