C++ Logo

std-proposals

Advanced search

Re: Restrict possible values of CHAR_BIT

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 28 Oct 2019 09:10:14 -0700
On Monday, 28 October 2019 08:47:26 PDT Arthur O'Dwyer via Std-Proposals
wrote:
> I also wonder what such a machine would do with `char8_t`, or character
> processing in general. (I mean, it could just waste half of the space in
> each 16-bit word; but it seems like it would be easier to just store two
> C++ "bytes" in each 16-bit word.)

You can do that, if you also shift the pointer addresses left and add an extra
bit to indicate whether you meant the lower or upper half of each word. And
correspondingly allowed dereferencing of each unit, individually.

Obviously, atomic_uint8_t, atomic_char, atomic_uchar, atomic_char8_t would not
exist.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

Received on 2019-10-28 11:12:35