C++ Logo


Advanced search

Re: [std-proposals] Slow bulky integer types (128-bit)

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 29 Mar 2023 09:45:09 +0100
On Wed, Mar 29, 2023 at 12:07 AM Jonathan Wakely <cxx_at_[hidden]> wrote:
> You're assuming that __uint128_t is an integral type.

Do you remember Barney the Dinosaur? The big purple dinosaur guy that
sang songs on television with children, "I love you... you love

I can dress up in a big purple Barney suit, but that doesn't make me a
dinosaur. And I can put a miniature made-to-fit tuxedo on my dog, but
that doesn't make him a business man -- he's still a dog.

It doesn't matter if you're from another planet, or if your first
language isn't English, the type '__uint128_t' is an integer type. If
the C++ Standard, or if any given C++ compiler, doesn't recognise it
as an integer type, then that's a totally different issue.

It isn't at all helpful to have false==std::is_integral_v<__int128>.
That's ridiculous. We know what an integer type is, we know what
128-Bit means, so __uint128_t is of course an integer type whose range
is 0 through 2^128-1 -- or an 'integral' type if you want to use the
adjectival/genitive form of the noun.

The expression 'is_integral_v<T>' should evaluate to true for any
compiler-built-in type that does mathematical operations on integers
(i.e. an integral type). Let's keep this simple.

We need to get our feet back on the ground and stop floating around up
in the clouds with abstract ideas. A rose is a rose is a rose. An
integer is an integer is an integer.

Received on 2023-03-29 08:45:21