![](/img/trans.png)
[英]Does the standard allow an implicit virtual destructor not being implicitly defined when no instances of its class are created?
[英]When there is a virtual function in a class, is the implicitly generated destructor virtual too?
假設我們有一個班級
class A
{
virtual void f();
};
默認析構函數是虛擬的嗎?
不 。 析構函數始終是非virtual
除非您明確說它是virtual
或類具有帶virtual
析構函數的基類。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.