Article View: de.comp.lang.c++
Article #723Re: Frage: illegal structur operation
From: Andreas Schwab
Date: Fri, 03 Nov 1995 11:30
Date: Fri, 03 Nov 1995 11:30
29 lines
1942 bytes
1942 bytes
In article <47cq9j$cgb@zeus.rbi.informatik.uni-frankfurt.de>, benni@dares.rbi.informatik.uni-frankfurt.de (Benjamin Baermann) writes:
|> In <477ms4$gim@deimos.rz.uni-osnabrueck.de> mgieseki@carina.rz.uni-osnabrueck.de (Martin Gieseking) writes:
|>> Warum machst du's dir unnoetig schwer und definierst fuer diesen einfachen Typ
|>> eine Klasse? Ein einfaches enum boolean {FALSE,TRUE} reicht doch schon. Die
|>> logischen Operatoren wie ||, && und ! funktionieren auch so.
|> Aber nur, weil der Compiler enums als ints ab 0 ablegt. Dazu ist er aber
|> nicht verpflichtet, oder?
Doch. Enums fangen immer mit 0 an, falls nichts anderes angegeben
wurde.
|> In C kenn ich die Variante:
|> #define FALSE 0
|> #define TRUE !FALSE
|> ist natuerlich fuer C++ eigentlich nicht zu empfehlen, weil kein
|> Type-Checking gemacht wird.
|> Im neuen Standard sollen doch booleans sowieso mit aufgenommen werden,
|> oder?
Es gibt die neuen Schluesselwoerter bool, true und false. Das ist in
GCC schon implementiert.
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
Technical Details
Message-ID:
<vyz68h2ylyv.fsf@lamothe.informatik.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!Informatik.Uni-Dortmund.DE!newsReferences:
<474ur7$cul@apopi.u-strasbg.fr> <477ms4$gim@deimos.rz.uni-osnabrueck.de> <47cq9j$cgb@zeus.rbi.informatik.uni-frankfurt.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!Informatik.Uni-Dortmund.DE!news From: schwab@lamothe.informatik.uni-dortmund.de (Andreas Schwab) Newsgroups: de.comp.lang.c++ Subject: Re: Frage: illegal structur operation Date: 03 Nov 1995 12:30:16 +0100 Organization: Dortmund University, Germany Sender: schwab@lamothe.informatik.uni-dortmund.de Message-ID: <vyz68h2ylyv.fsf@lamothe.informatik.uni-dortmund.de> References: <474ur7$cul@apopi.u-strasbg.fr> <477ms4$gim@deimos.rz.uni-osnabrueck.de> <47cq9j$cgb@zeus.rbi.informatik.uni-frankfurt.de> Reply-To: schwab@issan.informatik.uni-dortmund.de NNTP-Posting-Host: lamothe.informatik.uni-dortmund.de In-reply-to: benni@dares.rbi.informatik.uni-frankfurt.de's message of 3 Nov 1995 10:18:27 GMT X-Newsreader: Gnus v5.0.9