C++ Logo

std-proposals

Advanced search

Re: [std-proposals] 128-bit integers

From: Jan Schultke <janschultke_at_[hidden]>
Date: Sun, 11 Feb 2024 15:10:17 +0100
> The issue is not that `long long` shouldn't be a valid type for `int_least128_t`, it's that we don't spec that it's guaranteed to be so, which is different from every other `int_leastN_t` ...

It's not really so different. It's neither guaranteed that
int_leastN_t is a standard integer type, nor guaranteed that it isn't.
It's simply up to the implementation.

We're only specifying a new standard type if long long isn't 128-bit,
otherwise this changes nothing. However, I will concede that it would
be easier to extend existing overload sets by a 128-bit integer if it
was guaranteed to be distinct from long long. I think I'll actually
put that into my proposal.

I don't really see an issue with a mandatory extended integer type.
It's not like you can change the set of standard integer types without
breaking ABI and a large amount of other code, so this is a reasonable
option.

> FTR, mandating int128_t, effectively mandates `CHAR_BIT`

That's why the proposal mandates int_least128_t. int128_t is optional.

Received on 2024-02-11 14:10:29