home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!opl.com!regina!harvey
- From: harvey@opl.com (Harvey Reed)
- Newsgroups: comp.std.c++
- Subject: Re: Compiler should generate virtual destructors
- Message-ID: <harvey.727664973@regina>
- Date: 22 Jan 93 01:09:33 GMT
- References: <1992Dec31.050150.28929@ucc.su.OZ.AU> <lkc2k7INNajv@exodus.Eng.Sun.COM>
- Sender: news@opl.com
- Lines: 38
-
- db@argon.Eng.Sun.COM (David Brownell) writes:
-
- >...
- >So, a pair of proposals that I'd be happier to see accepted:
-
- > (1) It is an error for a class to have virtual functions and a
- > nonvirtual destructor.
- >
- > (2a) C++ compilers don't automagically generate ANYTHING for classes
- > any more: constructors, destructors, assignment and address-of
- > operators, etc. If such routines are used but not declared and
- > defined, that is an error.
-
-
- I like this! Compilers could have "compatibility" switches, but for
- those of us who would rather do it ourselves, we could use the
- full strength version.
-
- I think I would feel a lot better about my C++ compiler if I didn't
- have to make a copy-ctor private/unimplemented (as a safegaurd) just
- because I was afraid that I *might* be accidentally copying an object.
- It would be much better if the compiler simply said it was an error
- to copy without a copy-ctor (or whatever), then the programmer can:
-
- 1) remove the need to copy
- 2) install the proper method to do the copy
-
- This goes for all the other automagic stuff too! I cringe when I
- think about automagically adding virtual destructors, even though
- they are most times needed...
-
-
-
- --
- ++harvey
- ===========================================================================
- internet: harvey@opl.com / hreed@cs.ulowell.edu / h.reed@ieee.org
- voice/fax: 617-965-0220 / 617-965-7599
-