From kde-core-devel Mon Oct 04 18:56:39 2004 From: Richard Dale Date: Mon, 04 Oct 2004 18:56:39 +0000 To: kde-core-devel Subject: Re: RFC: A new helper class Message-Id: <200410041956.39898.Richard_Dale () tipitina ! demon ! co ! uk> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=109691616427330 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