Article View: comp.std.c++
Article #2549Re: Virtual functions and destructors
From: Herb Sutter
Date: Sat, 11 Nov 1995 04:37
Date: Sat, 11 Nov 1995 04:37
25 lines
1644 bytes
1644 bytes
In article <4805l3$hst@steel.interlog.com>, I wrote: >> May I inquire when you would ever *not* want the destructor to be virtual? > >Check out the FAQ under Question 75 (or thereabouts, the number may have >changed slightly since my version), Cline's FAQ book under Questions 98-99, >Scott Meyers' "Effective C++" (can't recall the section as I loaned the book >to someone), C++PL2 pg 216, D&E concidentally also pg 216, etc. I got off my duff and fetched the latest FAQ. It's number 79 now, not 75. >Short answer: When the class has no other virtual functions and you'll never >destroy derived objects through a base pointer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Herb Sutter 2228 Urwin, Ste 102 voice (416) 618-0184 Connected Object Solutions Oakville ON Canada L6L 2T2 fax (905) 847-6019 --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<480s28$oi0@steel.interlog.com>Path:
arc1-ca.pugleaf.net!library.ucla.edu!agate!agate!MattReferences:
<47r71q$cp0@bigboote.WPI.EDU> <martelli.815930692@cadlab> <47u94u$4of@bigboote.WPI.EDU> <4805l3$hst@steel.interlog.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!library.ucla.edu!agate!agate!Matt From: herbs@interlog.com (Herb Sutter) Newsgroups: comp.std.c++ Subject: Re: Virtual functions and destructors Date: 11 Nov 1995 04:37:42 GMT Organization: Connected Object Solutions (div of Daystar Software Systems Design Inc.) Approved: Matt@Austern Message-ID: <480s28$oi0@steel.interlog.com> References: <47r71q$cp0@bigboote.WPI.EDU> <martelli.815930692@cadlab> <47u94u$4of@bigboote.WPI.EDU> <4805l3$hst@steel.interlog.com> NNTP-Posting-Host: austern.hip.berkeley.edu