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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: New C++ type: boole
  5. Message-ID: <1992Jul29.195155.15634@microsoft.com>
  6. Date: 29 Jul 92 19:51:55 GMT
  7. Organization: Microsoft Corporation
  8. References: <DOUGM.92Jul26151240@titan.cs.rice.edu> <1992Jul27.144523.2372@mksol.dseg.ti.com>
  9. Lines: 34
  10.  
  11. In article <1992Jul27.144523.2372@mksol.dseg.ti.com> mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
  12. |Sounds like you just broke a big part of the world to me.  This is
  13. |also highly non-orthoganal, in that you have a quantity ('ptr') which
  14. |you say you are going to issue a warning on in a logical context, but
  15. |you can do a simple negation and it becomes acceptable.  It should
  16. |work the same way for 'ptr' and '!ptr'; either both should be legal or
  17. |both should give warnings.  If you make both give warnings, you have
  18. |once again broken a big part of the world.  Hence, neither should give
  19. |warnings. 
  20.  
  21. If 'boole' is not going to break millions of lines of existing code, then
  22. at least the following *implicit* conversions have to be supported:
  23.  
  24. int to boole
  25. boole to int
  26. pointer to boole
  27.  
  28. Given these implicit conversions, the only remaining "feature" I can
  29. see for boole is that it allows one to "exact match" on function parameters:
  30.  
  31.     cout << (foo == bar);
  32.  
  33. could cause "TRUE" or "FALSE" to be printed, for example.
  34.  
  35. A similar, and more important problem [IMHO] occurs because w_char is not
  36. a separate type:
  37.  
  38.     w_char chSqrt = '\x221A';
  39.  
  40.   cout << chSqrt;
  41.  
  42. doesn't cause the Unicode square root sign to be printed out, but rather
  43. some decimal integer.
  44.  
  45.