Article View: comp.std.c++
Article #1811Re: true/false literal std question
From: vinoski
Date: Tue, 22 Aug 1995 18:02
Date: Tue, 22 Aug 1995 18:02
30 lines
1814 bytes
1814 bytes
Distribution: In article <417kfc$1q3@engnews2.Eng.Sun.COM> Steve Clamage writes: >If true and false were introduced into the preprocessor, they would >have to be predefined to the preprocessor numbers 1 and 0. They would >then be the only prefined literals in the preprocessor. Why would this >be superior to just using 1 and 0 in your code, given that there are >no types to begin with? That is, IMHO 'true' gives no advantage >whatever over '1' in a preprocessor expression, since it cannot mean >anything different from '1', and since it must iteract with expressions >with integer (not boolean) values. 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. --steve Steve Vinoski vinoski@ch.hp.com (508)436-5904 Distributed Object Computing Program fax: (508)436-5122 Hewlett-Packard, Chelmsford, MA 01824 Standard Disclaimer: All opinions expressed are my own and do not represent official statements of the Hewlett-Packard Company. --- [ 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.95Aug22110224@physics2.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!128.32.155.1!mattReferences:
<4167na$nv9@engnews2.Eng.Sun.COM> <416oev$71f@mujibur.inmind.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt From: vinoski@apollo.hp.com Newsgroups: comp.std.c++ Subject: Re: true/false literal std question Date: 22 Aug 1995 18:02:24 GMT Organization: Hewlett-Packard Company, Chelmsford, MA Approved: matt@physics2.Berkeley.EDU (Matt Austern) Message-ID: <MATT.95Aug22110224@physics2.Berkeley.EDU> References: <4167na$nv9@engnews2.Eng.Sun.COM> <416oev$71f@mujibur.inmind.com> NNTP-Posting-Host: physics2.berkeley.edu