Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::exception_detail::error_info_base does not have virtual destructor
From: Ted Byers (r.ted.byers_at_[hidden])
Date: 2011-03-17 16:39:26


>From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net