C++ Logo


Advanced search

Re: [std-proposals] Integer overflow arithmetic

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Sat, 17 Feb 2024 12:15:41 +0000

>> 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.

Ok, this is not the behavior that I want.
I see that there's allot of confusion regarding this, which might need clarification.
I think It would be better for me to create a set of test cases so that anyone who wants can play around with it.
Give me sometime I will get back to this with some code.

Received on 2024-02-17 12:15:43