C++ Logo

std-proposals

Advanced search

Re: [std-proposals] LWG making integers more portable

From: Bjorn Reese <breese_at_[hidden]>
Date: Mon, 16 Feb 2026 15:12:20 +0100
On 2/16/26 14:41, Jan Schultke via Std-Proposals wrote:

> Maybe once we have _BitInt, we could add std::bit_int_unpadded_tand
> std::bit_int_fast_ttraits that give you the next larger _BitIntwithout
> padding, and the next larger _BitIntthat is "fast".

Or the proposed type traits can be extended with _BitInt once it is
landed.

I would rename the type traits to be more consistent with existing
type traits though

   make_least<N> -> make_signed_least<N>
   make_uleast<N> -> make_unsigned_least<N>

> I'm not so sure we want such traits for the standard integer types.

Such traits are useful when doing integer computation without overflow,
where you want to use a wider integer type for the computation. Promoted
integer types already does this implicitly, and the traits just make
that an explicit choice. This enables generic integer computation code
that also works with std::simd types.

Received on 2026-02-16 14:12:24