Article View: comp.std.c++
Article #3542Re: An Extra Virtual Destructor Question to Ponder
From: Wim Veldhuis
Date: Wed, 28 Feb 1996 18:18
Date: Wed, 28 Feb 1996 18:18
33 lines
2290 bytes
2290 bytes
In message <47voa1$969@gabi.gabi-soft.fr> - kanze@gabi-soft.fr (J. Kanze)
writes:
:>
:>
:>john (j.d.) hickin (hickin@bnr.ca) wrote:
:>
:>|> class X { public: X(); virtual ~X() = 0; };
:>
:>|> Has this been considered?
:>
:>In what way? This has always been legal, and I see nothing in the
:>present draft to change it. I occasionally use the idiom to force a
:>class to be abstract even when I want to provide default behavior for
:>all of the member functions.
Yes, but there is a difference between a normal member function and a dtor.
The normal memberfunction has to be called explicitly before it is invoked.
If the function is overridden, it is not called unless you explicitly call it
from the overridden version. Doing this will generate an error since their
actually is no implementation for the function called. With dtors, this is
different as all inherited dtors are automatically called when an object is
destructed. What you are saying here is that there is somewhere in the draft
a rule which states that if a dtor is declared pure virtual, a default
implementation (or none at all) is automatically created. Is this the case ?
Wim Veldhuis,
veldhuis@xs4all.nl
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<4h25rb$43e@news.xs4all.nl>Path:
arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austernReferences:
<47t2s1$ivm@bmtlh10.bnr.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern From: veldhuis@xs4all.nl (Wim Veldhuis) Newsgroups: comp.std.c++ Subject: Re: An Extra Virtual Destructor Question to Ponder Date: 28 Feb 1996 10:18:01 PST Organization: XS4ALL, networking for the masses Approved: austern@isolde.mti.sgi.com Message-ID: <4h25rb$43e@news.xs4all.nl> References: <47t2s1$ivm@bmtlh10.bnr.ca> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 28 Feb 1996 18:10:51 GMT X-Newsreader: NeoLogic News for OS/2 [version: 4.2] X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMTSca0y4NqrwXLNJAQG6/wH+K7DPPN6tZ8AMKeTxqQeOkli4MHmTlwps Hh1/FTzaGgmuadp2EarwtHzP5lJRBDRpjMJ2EgszYXY+wlBnYUm4Hg== =8Cn1 Originator: austern@isolde.mti.sgi.com