Subject: Re: Why is size_type in std::array an alias for size_t?
From: Bo Persson (bo_at_[hidden])
Date: 2019-11-09 10:14:37
On 2019-11-09 at 12:41, Wilhelm Meier via Std-Discussion wrote:
> Am 09.11.19 um 11:30 schrieb Lyberta via Std-Discussion:
>> Wilhelm Meier via Std-Discussion:
>>>> Of course, bigger problem is that CHAR_BIT can be more than 8.
>>> I dont't see the point here. Can you elaborate on that?
>> That means that generally reasoning about sizes of types is difficult.
>> What if CHAR_BIT is 10?
>> Then both Size < 256 and Size < 65536 don't make sense as now all the
>> numbers derived from number of bits in a byte are different.
> Yes of course. But my proposal was to use uint8_t oder uin16_t, so the
> CHAR_BIT doen't matter here.
But if CHAR_BIT is 10, you probably don't have any char8_t or char16_t
types. So in a way it *does* matter.
STD-DISCUSSION list run by firstname.lastname@example.org
Older Archives on Google Groups