Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-05-03 13:12:29


On Sat, May 3, 2008 at 8:00 AM, Hartmut Kaiser <hartmut.kaiser_at_[hidden]> wrote:
> What's the problem with making the destructor virtual in the first place?
> Since the class already has other virtual functions this won't generate any
> (significant) additional overhead (the only thing what's added is another
> function pointer to the already existing virtual function table, barely
> something to worry about).

I am not concerned about overhead.

In C++, you use virtual function calls only when your design requires
polymorphic behavior. My design does not.

If GCC issued a warning if you have a non-virtual function in a class
that has some virtual functions, would you make the non-virtual
function virtual? (hint: much like the destructor case, using
non-virtual function in the first place _could_ be a serious bug.)

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk