C++ Logo


Advanced search

Re: Restrict possible values of CHAR_BIT

From: Lyberta <lyberta_at_[hidden]>
Date: Thu, 24 Oct 2019 18:19:00 +0000
Tom Honermann:
> What is the motivation? What problem(s) would this solve?

A code that doesn't depend on a particular size of a byte will be easier
to write and easier to reason about.

C++20 requires integers to be two's complement because there is no
relevant hardware with other representations.

Why not to restrict values of CHAR_BIT to values that are relevant too?

I'm working on a proposal for sane integer types that introduces new
context-sensitive keywords in the form intN. If we restrict CHAR_BIT
now, then the wording and reasoning for new types becomes much easier.


Received on 2019-10-24 13:21:59