public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andreas Fredriksson <deplinenoise@gmail.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Re: Re: KDE 3.4 visibility support disabled
Date: Thu, 26 May 2005 18:09:19 +0200	[thread overview]
Message-ID: <3212b1a80505260909506ed4e1@mail.gmail.com> (raw)
In-Reply-To: <200505260726.24954.caleb@gentoo.org>

On 5/26/05, Caleb Tennis <caleb@gentoo.org> wrote:

> On Thursday 26 May 2005 02:30 am, Duncan wrote:
> > So the KDE problem... Is that what's causing all those virtual function
> > but destructor isn't virtual type warnings whenever I compile a KDE ebuild
> > with gcc4?
> 
> No, that's just shoddy C++ coding that also needs to be fixed.

Sorry to cut in like this, but I get tired of comments like this.
While this specific case might very well represent "shoddy" coding,
there are perfectly good reasons to have non-virtual destructors in
classes designed to be base classes.

One common case is when COM-style reference counting is used. In such
a scenario leaf classes always implement a release() member function
which deletes 'this' when the reference count goes to zero. With this
configuration there is no need for a virtual destructor since
destructor chaining always happens from a leaf class.

I hope one day GCC's warning for this will be smart enough to at least
not complain about non-public non-virtual destructors in classes that
otherwise contain virtual member functions. Then the warning will be
useful and perhaps indicate "shoddy C++ coding". :-)

// Andreas

-- 
gentoo-dev@gentoo.org mailing list


  reply	other threads:[~2005-05-26 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-25 16:48 [gentoo-dev] KDE 3.4 visibility support disabled Marcus D. Hanwell
2005-05-25 18:02 ` Jason Wever
2005-05-25 23:37 ` [gentoo-dev] " Duncan
2005-05-25 23:57   ` Diego 'Flameeyes' Pettenò
2005-05-26  4:25   ` [gentoo-dev] Re: [gentoo-amd64] " Dan Armak
2005-05-26  7:30     ` [gentoo-dev] " Duncan
2005-05-26 12:26       ` Caleb Tennis
2005-05-26 16:09         ` Andreas Fredriksson [this message]
2005-05-26 11:05   ` [gentoo-dev] " Marcus D. Hanwell
2005-05-26 23:23     ` [gentoo-dev] " Duncan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3212b1a80505260909506ed4e1@mail.gmail.com \
    --to=deplinenoise@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox