If bool has one bit, wouldn’t that bit be the signed bit?

I.e. true < false

 

From: Std-Proposals <std-proposals-bounces@lists.isocpp.org> On Behalf Of Sebastian Wittmeier via Std-Proposals
Sent: Monday, April 14, 2025 3:56 PM
To: std-proposals@lists.isocpp.org
Cc: Sebastian Wittmeier <wittmeier@projectalpha.org>
Subject: Re: [std-proposals] std::arithmetic (concept)

 

Yes, that's consequent. The signed (2-complement) values go 1 more into negative than positive direction.

So 1 bit: -1..0

 

On the other hand: Bool goes to a maximum of +/-1, so it could also be [-true, false, true]?


 

-----Ursprüngliche Nachricht-----
Von: Robin Savonen Söderholm <robinsavonensoderholm@gmail.com>
Gesendet: Mo 14.04.2025 15:58
Betreff: Re: [std-proposals] std::arithmetic (concept)
An: std-proposals@lists.isocpp.org;
CC: Sebastian Wittmeier <wittmeier@projectalpha.org>;

signed bool -> [false, -true]?

// Robin

 

On Mon, Apr 14, 2025, 15:56 Sebastian Wittmeier via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

And ubool_least64_t, bool_fast16_t, uboolmax_t
 

-----Ursprüngliche Nachricht-----
Von: Avi Kivity via Std-Proposals <std-proposals@lists.isocpp.org>

 

This calls for `signed bool`, `long short signed bool`, etc.

 

--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals