Skip to content

Glossary: C++ Beyond the Basics

Virtual destructor

Also written: virtual ~Base

A destructor declared `virtual ~Discount() = default;` so that deleting through a base pointer runs the derived class's destructor too. Any class with virtual functions needs one.

Where the book teaches it

Related terms

Virtual functionAbstract class