
17 Mar
2011
17 Mar
'11
8:39 p.m.
From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Frank Mori Hess
On Thursday, March 17, 2011, Ted Byers wrote:
Again, can you point to a significant downside to having all destructors virtual?
The usual reason given is that if the class has no other virtual functions, then making the destructor virtual adds some size overhead to each object, since they have to keep a pointer to a virtual function table.
That's why I teach the kids to make the destructor virtual IF they need to make some other member function virtual. But I don't usually take them to the various optimization issues until they're at the intermediate level. Cheers Ted