Re: virtual destructor revisted

From: Phlip (phlip_cpp_at_yahoo.com)
Date: 06/20/04


Date: Sun, 20 Jun 2004 13:00:20 GMT

David Harmon wrote:

> E. Robert Tisdale wrote,
> >
> >This is *very* bad advice.
> >If all C++ destuctors were meant to be virtual,
> >that feature would have been built into the language --
> >or the language would have been renamed Java.
>
> Come on, Robert, you know it's only very ordinary everyday grade bad
> advice. Sure it will make your programs slower and eat a bit more
> memory for no good reason, but I can't think of a case where it will
> make them give wrong answers or undefined behavior. And it might even
> save somebody's clueless ***, once in a blue moon. I told you a
> million times not to exaggerate.

How much slower?

It's a loaded question. Even figuring out how much slower spends time that
you could have used to take 'new' out of your design, which would make your
destructors early-bound.

Premature optimization is the root of all evil. Not "some" evil.

-- 
  Phlip
  http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces