Question about pure virtual destructor

前端 未结 4 1568
时光说笑
时光说笑 2020-12-02 00:24

If we define a abstract class which has a pure virtual destructor, why do we have to give a definition of a destructor in the abstract class?

4条回答
  •  天命终不由人
    2020-12-02 01:02

    The destructor for the base class must be called when the object is destroyed, so it needs a definition.

提交回复
热议问题