Why are destructors not virtual by default [C++]
问题 Why doesn't C++ make destructors virtual by default for classes that have at least one other virtual function? In this case adding a virtual destructor costs me nothing, and not having one is (almost?) always a bug. Will C++0x address this? 回答1: You don't pay for what you don't need. If you never delete through base pointer, you may not want the overhead of the indirected destructor call. Perhaps you were thinking that the mere existence of the vtable is the only overhead. But each individual