Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    As for virtual destructor see: When to use virtual destructors? since your class has a virtual function it should also have a virtual destructor. Commented Jan 15, 2016 at 2:49
  • 1
    You should add a virtual destructor if you destruct your class in a polymorphic context. If that definition does not ring a bell with you yet, then just always add one. Note that in the example of @SalahSalah there is no destructor call at all. Commented Jan 15, 2016 at 5:03