Article View: comp.std.c++
Article #1583Re: What!!! true and false not identifiers?
From: Dag Bruck
Date: Fri, 04 Aug 1995 10:22
Date: Fri, 04 Aug 1995 10:22
36 lines
1543 bytes
1543 bytes
In article <NEWTNews.807452778.29822.Trebor@eagle.lute.qnet.com>,
Trebor A. Rude <trebor@en.ecn.purdue.edu> wrote:
>
>An alternitive that would allow both overloading and implicit type
>conversions is something like this:
>
>enum BOOLEAN { false, true };
>
>class bool {
> BOOLEAN value;
>public:
> // Put in type conversion, operators, etc.
>}
>
>Granted, it takes two identifiers, but I think it comes closest to
>implementing the type as the draft standard does (at least among
>what I've seen so far).
Yes but what does it do to overloading...
void f(int); // calls this one
void f(bool);
void f(BOOLEAN);
f( x < 3 );
You really want your bool type to be exactly the type returned
by the relational operators.
-- Dag Bruck
--
Dynasim AB Phone: +46 46 182500
Research Park Ideon Fax: +46 46 129879
S-223 70 Lund E-mail: Dag@Dynasim.se
Sweden URL: http://www.dynasim.se
Technical Details
Message-ID:
<DCs7I6.Irw@akropolis.malmo.trab.se>Path:
arc1-ca.pugleaf.net!akropolis.malmo.trab.se!dagReferences:
<fwv3ffkzm98.fsf@oculus.aifh.ed.ac.uk> <3vo825$k9n@engnews2.Eng.Sun.COM> <NEWTNews.807452778.29822.Trebor@eagle.lute.qnet.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!akropolis.malmo.trab.se!dag From: dag@net.dynasim.se (Dag Bruck) Subject: Re: What!!! true and false not identifiers? X-Nntp-Posting-Host: net.dynasim.se Message-ID: <DCs7I6.Irw@akropolis.malmo.trab.se> Sender: news@akropolis.malmo.trab.se (News adm) Organization: Dynasim AB, Lund, Sweden References: <fwv3ffkzm98.fsf@oculus.aifh.ed.ac.uk> <3vo825$k9n@engnews2.Eng.Sun.COM> <NEWTNews.807452778.29822.Trebor@eagle.lute.qnet.com> Date: Fri, 4 Aug 1995 10:22:54 GMT