C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Integer overflow arithmetic

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Sat, 17 Feb 2024 13:03:53 +0100
On 17/02/2024 09:00, Jan Schultke via Std-Proposals wrote:
> I would name it "is_representable_as" or "representable_as". This has
> a lot of precedent; for example, a narrowing conversion is valid if
> the target type can "represent all the values of the original type".
> You could also call it "is_narrowing", but that would be misleading
> because a function template cannot test for narrowing conversion.

I have a feeling that this is already covered by two papers of mine
currently in flight:

https://wg21.link/p0870 for detecting narrowing conversions;
https://wg21.link/p2509 for detecting value-preserving conversions.

(P0870 is between LEWG and LWG, currently blocked by P3146. I really
need to find some time to update P2509.)

Thank you,
-- 
Giuseppe D'Angelo

Received on 2024-02-17 12:03:56