Hello All,
I'm new to C++ (been an Ada guy for over 20 years), and I've search but can't find an answer to my question on the Web (big place!), so I'm hoping you Gurus come help me.
I know that for virtual functions, if you declare it with an "= 0" (pure virtual) it not only designates the base class as an "abstract class", but also forces the derived class to define an implementation.
Is there a way to do this for variables? What I really want is something like (not 100% on syntax, so please forgive):
class Base
{
public:
virtual void dummyMakeMeAbstract() = 0; // don't allow instantiations
protected:
virtual const static typeXXX mustOverrideVariable;
}
class Derived : public Base
{
public:
void dummyMakeMeAbstract(){};
protected:
const static typeXXX mustOverrideVariable = myValue;
}
I could live without the const static behavior if I had to.
Thanks in advance !!!