home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mole-end!mat
- From: mat@uunet.uu.net!mole-end
- Subject: Re: Language extensions for run-time type identification
- Message-ID: <1992Jul25.070247.3925@uunet.uu.net!mole-end>
- Summary: Humptying and Dumptying about Const
- Organization: :
- References: <1992Jul21.143131.6902@cadsun.corp.mot.com> <rmartin.711829160@thor> <1992Jul23.175944.9090@microsoft.com>
- Date: Sat, 25 Jul 1992 07:02:47 GMT
- Lines: 43
-
- In article <1992Jul23.175944.9090@microsoft.com>, jimad@microsoft.com (Jim Adcock) writes:
- > In article <23284@alice.att.com> ark@alice.UUCP () writes:
- > >In article <rmartin.711829160@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
- > |
- > |> Posh! Every class should have a virtual destructor. It is insane not
- > |> to declare the destructor virtual. There is only one, small,
- > |> exception to this rule, which has to do with structs placed in ROM...
- > |
- > |How about classes associated with small objects, such as Complex and Point?
-
- > Exactly! How ABOUT them?
-
- > They OUGHT to be ROMABLE. They OUGHT to be guaranteed to be const.
- > A programmer writing:
-
- > const complex imag_pi(0, pi);
-
- > OUGHT to be able to assume that his/her constant IS constant, and generates
- > the quality of code expected of constants.
-
- > BUT, none of this is true given the committee's decision to support
- > "Humpty Dumpty" const.
-
- Eh? Under the current proposal, if the class has no ~const members
- AND IF IT HAS NO CONSTRUCTORS OR DESTRUCTORS it can be placed in ROM.
- Complex should probably have constructors or destructors, so it is left
- out, but that has nothing to do with Humpty Alice Dumpty.
-
- On the other hand, under the current proposal, with no ~const members,
- casting away const for classes can be reduced to the unsupported sort
- of thing you are asking for. The class declaration, by default, supports
- bitwise const; with the appropriate declarations the meaning of const is
- weakened for that class. It's up to the implementor of the class.
-
- What more do you need? I grant you, this is just a proposal, but it's
- one the Extensions WG actually likes. If the gruelling analysis to which
- it must be put doesn't discover any serious obstacles, the WG is likely to
- recommend it to the full co-committee.
- --
- (This man's opinions are his own.)
- From mole-end Mark Terribile
-
- uunet!mole-end!mat, Somewhere in Matawan, NJ
-