[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: RFC: A new helper class
From: Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date: 2004-10-04 18:56:39
Message-ID: 200410041956.39898.Richard_Dale () tipitina ! demon ! co ! uk
[Download RAW message or body]
On Monday 04 October 2004 19:37, Jarosław Staniek wrote:
> As Richard Dale mentioned, booleans are booleans. Unlike simple enum,
> tristate inherits everything from bool type, I mean: operators !, =, and
> implicity casts to (bool).
>
> Operator ~ is consistent addition, in my opinion. Thus even "! ~" working
> as "not cancelled" :)
>
> With tristate class you can forget about it's additional meaning and just
> treat it as a bool.
Surely you're disagreeing with me. Booleans have two states true and false -
that's the definition of a boolean. You should never have to write code which
depends on whether true is 1 or false is 0 (what is -1 I can never quite
remember, and I've only been coding C since 1987?). C should have had a
boolean type from the start, this business about an int with a value of 0
being false, and anything else being true is just a design flaw. No need to
reproduce that nonsense in a modern api.
-- Richard
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic