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