Connecting Tech Pros Worldwide Help | Site Map

confusion with abstract methods.

TheFerryman
Guest
 
Posts: n/a
#1: Jul 22 '05
Why doesn't compile? I would have thought the dtor of Base would call
Derived::f()

struct Base
{
virtual void f() = 0;

virtual ~Base(){f();}
};

struct Derived : public Base
{
virtual void f(){cout << "\nIn Derived f";}
};

int main()
{
Derived d;

return 0;
}
Closed Thread