C++ Logo

std-proposals

Advanced search

Re: [std-proposals] 128-bit integers

From: Jan Schultke <janschultke_at_[hidden]>
Date: Sun, 11 Feb 2024 20:58:27 +0100
As Jonathan has pointed out, std::intN_t et al. can be defined if the
implementation can support it. Otherwise yes, the standard library
cannot define arbitrary symbols.

> You can't reasonably use <cstdint> least* types to define overload sets.

Yeah, for sure. Nevertheless, an overload set with unsigned long long
and std::uint_least128_t would be fine because my proposal requires
all aliases for N > 64 to be extended integers. That way, you can at
least extend existing int/long/long long sets with std::int_least128_t
without worrying that a standard type is 128-bit. See
https://eisenwave.github.io/cpp-proposals/int-least128.html#impact-on-overload-sets

This breaks no existing code because no implementation provides
aliases beyond N = 64 anyway.

Received on 2024-02-11 19:58:40