home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!newshub.a!ariel.yorku.ca!cs911209
- From: cs911209@ariel.yorku.ca
- Newsgroups: comp.lang.c++
- Date: 18 Jul 92 03:50 MDT
- Subject: Re: boolean (was: Re: typedef vs enum)
- Sender: Notesfile to Usenet Gateway <notes@glas.apc.org>
- Message-ID: <1992Jul17.235055.13535@newshub.a>
- References: <1992Jul11.195547.18323@cmcl2.nyu>
- Nf-ID: #R:1992Jul11.195547.18323@cmcl2.nyu:1382747533:1992Jul17.235055.13535@newshub.a:231667568:001:1037
- Nf-From: ariel.yorku.ca!cs911209 Jul 18 03:50:00 1992
- Lines: 36
-
-
- In article <DOUGM.92Jul17133255@titan.cs.rice.edu> dougm@titan.cs.rice.edu (Doug Moore) writes:
- >In article <23195@alice.att.com> ark@alice.att.com (Andrew Koenig) writes:
- >Andrew> I would love to see a built-in Boolean type in C++, but
- >Andrew> unfortunately it's too big a change from C.
- >
- 6 lines deleted..
-
- >I would also love to see a built-in Boolean type in C++. I would
- >gladly engage in a discussion on how it could be done. What specific
- >problems do you believe make a Boolean-type extension to C++
- >infeasible?
- >
-
- One thing that makes C a nice language to program in, is the fact
- that NULL and 0 can mean false, and non-NULL and non-zero can mean true.
- I would like to see some kind of consistent boolean type in C++,
- but I would also like to be able to say:
-
- SomeObject *ptr;
- ...
- while (ptr)
- ...
-
- and:
-
- if (!(fptr = fopen( "myfile", 'r')))
-
- etc.
-
- I think the best way to do this would be to have some typecasting
- rules from int to boolean and from pointer types to boolean.
-
- Michael Davis York University, Toronto
-
-
-