C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D4037R0 Allowing signed char and unsigned char in random number generation

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 26 Feb 2026 18:35:55 +0100
On 26/02/2026 18:27, Jan Schultke via Std-Proposals wrote:
> Dunno, maybe. To be fair, this isn't runtime UB but IFNDR. The conundrum
> is that while libstdc++ supports character types and types such as
> __int128, which historically wasn't considered an extended integer type.
> If you say that there are optionally supported types, the wording has to
> make sense for them, and I fear that the wording wouldn't make any sense
> for a type like __int128 if it isn't even considered an integer.

Well, specifically for GCC, this has changed in GCC 16. Now __int128 is
considered an extended integral type in standard C++ modes; before only
in GNU compatibility (-std=gnu++NN) modes. So it is officially an
extended integer type (is_integral is true, numeric_limits is
specialized for it, etc.). Whether it actually works when used in [rand]
in libstdc++, I don't know; but still, my point is that the fewer
"undefined" stuff we leave around, the better.

My 2 c,
--
Giuseppe D'Angelo

Received on 2026-02-26 17:36:00