class Base
{
int m_var;
public:
virtual void mf_0() = 0; //The contract. The compulsory Customization
virtual void mf_1(); //The customizable "default behaviour"
int m_f2(); // the invariant. Redefining this in derived class would mean
// the derived class is-not-really-a base class .. or that this
// non virtual function should really be virtual, i.e. customizable
virtual ~Base() {};
};
class Derived : public Base
{
public:
virtual void mf_0()
{
}
};
int main()
{
Derived D1;
}
This produces undefined reference to `vtable for Base’
1