Connecting Tech Pros Worldwide Help | Site Map

confusion with abstract methods.

  #1  
Old July 22nd, 2005, 09:58 AM
TheFerryman
Guest
 
Posts: n/a
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confusion with using abstract classes and COM objects Benjamin answers 0 November 16th, 2005 03:07 PM
confusion with abstract methods. TheFerryman answers 6 July 22nd, 2005 09:59 AM
confusion with abstract methods. TheFerryman answers 6 July 22nd, 2005 09:30 AM
All methods are virtual? Raymond Lewallen answers 20 July 21st, 2005 05:36 PM