home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- Path: sparky!uunet!spool.mu.edu!umn.edu!myria.cs.umn.edu!hansen
- From: hansen@myria.cs.umn.edu (David Hansen)
- Subject: Re: Compiler should generate virtual destructors
- Message-ID: <1993Jan4.003054.9295@news2.cis.umn.edu>
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: myria.cs.umn.edu
- Organization: University of Minnesota
- References: <1992Dec31.050150.28929@ucc.su.OZ.AU> <C0Ayt4.263@fiu.edu>
- Date: Mon, 4 Jan 1993 00:30:54 GMT
- Lines: 30
-
- In article <C0Ayt4.263@fiu.edu>, feathers@serss0 (Michael Feathers) writes:
- |> In article <1992Dec31.050150.28929@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- |> >I would like to propose that if a class has virtual functions,
- |> >then any destructor generated by the compiler will be virtual
- ^^^^^^^^^^^^^^^^^^^^^^^^^
- |> >by default.
- |> >
- [...]
-
- |> This would be a way in which a function within the source code would be
- |> virtual without the keyword 'virtual' having been used on it or a function of
- |> the same name in an inherited class. That would bother me as a consistency
- |> issue.
-
- I think you misread the original post. Only the automagically generated
- destructors would be virtual by default. If the programmer explicity
- defined a destructor _without_ the virtual keyword, it would not be virtual
- (unless _I_ misread the post :).
-
- |>
- |> >Disadvantage: might slow down destruction a little. Can be
- |> >fixed by the programmer explicitly declaring a non-virtual
- |> >destructor.
- |>
- |> The only way to make something explicity non-virtual would be the absence
- |> of the 'virtual' keyword, unless we add a new keyword <shudder>.
-
- Again, see comment above.
-
- -=Dave
-