re: Demystifying Virtual and Abstract Functions VIEW POST

VIEW FULL DISCUSSION
 

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.

 

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

code of conduct - report abuse