Article View: comp.std.c++
Article #1815Re: true/false literal std question
From: Robert Andrew Ryan
Date: Tue, 22 Aug 1995 20:08
Date: Tue, 22 Aug 1995 20:08
23 lines
1571 bytes
1571 bytes
Distribution: Excerpts from netnews.comp.std.c++: 22-Aug-95 Re: true/false literal std .. vinoski@apollo.hp.com (1339) > Also, if true and false were reduced to 1 and 0 by the preprocessor, > overloading on type bool would not be possible. I thought that > overloading was a big reason that bool was added to the language in > the first place. I would expect that if the preprocessor were enhanced to recognize true/false it would only do so in the context of #if, or #elif. I think the potential for confusion arising from the use of 1/0 for true/false in the preprocessor and true/false in C++ code warrants fixing the preprocessor to maintain consistency. It seems it would be fairly trivial to add two new literals named true and false to the preprocessor's expression parser... -Rob --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<MATT.95Aug22130804@physics2.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!128.32.155.1!mattReferences:
<4167na$nv9@engnews2.Eng.Sun.COM> <416oev$71f@mujibur.inmind.com> <MATT.95Aug22110224@physics2.Berkeley.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt From: Robert Andrew Ryan <robr+@andrew.cmu.edu> Newsgroups: comp.std.c++ Subject: Re: true/false literal std question Date: 22 Aug 1995 20:08:04 GMT Organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA Approved: matt@physics2.Berkeley.EDU (Matt Austern) Message-ID: <MATT.95Aug22130804@physics2.Berkeley.EDU> References: <4167na$nv9@engnews2.Eng.Sun.COM> <416oev$71f@mujibur.inmind.com> <MATT.95Aug22110224@physics2.Berkeley.EDU> NNTP-Posting-Host: physics2.berkeley.edu