home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!cs.uiuc.edu!sparc0b!pjl
- From: pjl@cs.uiuc.edu (Paul Lucas)
- Subject: Re: virtual functions need virtual destructors ?
- Message-ID: <By6IAD.FD@cs.uiuc.edu>
- Sender: news@cs.uiuc.edu
- Organization: University of Illinois at Urbana-Champaign
- References: <kilitzir.722528914@news.forth.gr>
- Date: Mon, 23 Nov 1992 17:08:37 GMT
- Lines: 16
-
- In <kilitzir.722528914@news.forth.gr> kilitzir@antigone.csi.forth.gr (Xristos Kilitzirakis) writes:
-
- >Why do virtual functions need virtual destructors ?
-
- *****> They don't. A _class_ that has virtual functions often
- requires a virtual d'tor if and only if objects of that class
- are deleted via a pointer to a class that is a base of that
- class so an object of the right size is deleted.
-
- >Hope to be easy question.
-
- *****> The answer is also in any C++ book.
- --
- - Paul J. Lucas University of Illinois
- AT&T Bell Laboratories at Urbana-Champaign
- Naperville, IL pjl@cs.uiuc.edu
-