home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15957 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.0 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mcsun!sunic!lth.se!newsuser
  3. From: dag@control.lth.se (Dag Bruck)
  4. Subject: Re: enum labels
  5. Message-ID: <1992Nov9.075707.21496@lth.se>
  6. Keywords: enum labels
  7. Sender: newsuser@lth.se (LTH network news server)
  8. Organization: Department of Automatic Control, Lund, Sweden
  9. References: <4026@bcstec.ca.boeing.com> <542@ulogic.UUCP>
  10. Date: Mon, 9 Nov 1992 07:57:07 GMT
  11. Lines: 23
  12.  
  13. In <comp.lang.c++> hartman@ulogic.UUCP (Richard M. Hartman) writes:
  14. >
  15. >I posted a kvetch about this a little while ago.  I agree that
  16. >allowing overloading of the simple types (int long float etc)
  17. >could lead to massive confusion and hard to find bugs, but an 
  18. >enum is NOT a simple type, and does not need the same protections.
  19.  
  20. The C++ standardization committee has voted to allow overloading based
  21. on enumerations, e.g.,
  22.  
  23.     enum Status {Fatal, Bad, Good};
  24.  
  25.     Status operator | (Status a, Status b)
  26.     {
  27.         if (int(a) < int(b))
  28.             return a;
  29.         else
  30.             return b;
  31.     }
  32.  
  33. I believe some compilers already permit it.
  34.  
  35.         -- Dag
  36.