home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11519 < prev    next >
Encoding:
Text File  |  1992-07-25  |  2.3 KB  |  55 lines

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