DEV Community

Discussion on: Demystifying Virtual and Abstract Functions

Collapse
 
drewmikola profile image
Drew Mikola

Good introduction to the topic, I only have one comment: the destructor of your base class should be marked virtual as well, since it is an inherited class. For the example it doesn't matter, however if both base and derived classes needed to perform unique and specific actions during destruction it will ensure that the object is fully destructed.

Collapse
 
codemouse92 profile image
Jason C. McDonald

Silly me - I should know that! (In my own code, I always do that.) I've edited accordingly.