C++ Logo

std-proposals

Advanced search

Re: [std-proposals] uint_nopro_fast32_t : Types in <cstdint> that don't promote

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Fri, 31 Mar 2023 16:12:16 +0200
On 31/03/2023 13:47, Frederick Virchanza Gotham via Std-Proposals wrote:
> So I wonder would it be good to have another set of integer types that
> don't promote?

Would it be too far fetched to generalize this, and propose a fully
policy-based integer type, with individual policies to decide:

- the bit width
- if it is signed or unsigned
- whether overflow/underflow is UB, or wrap around, or saturate
- if it takes part in integer promotions or not
- if it implicitly converts towards any other integer types, or forbids
narrowing, or doesn't implicitly convert at all
- etc.

My 2 c,
-- 
Giuseppe D'Angelo

Received on 2023-03-31 14:12:19