Section: 22.214.171.124 [iterator.concept.winc] Status: New Submitter: Jiang An Opened: 2023-02-19 Last modified: 2023-03-22 22:36:03 UTC
View all other issues in [iterator.concept.winc].
View all issues with New status.
Currently integer-class types are required to be wider than every integer type (126.96.36.199 [iterator.concept.winc]/3). As a result, if compiler provides extended integer types later whose width are not less than that of an integer-class type, then integer-class types with that width must be abandoned, which seems ABI-breaking (see also LWG 3828).I think we should allow some extended integer types to be wider than some integer-class types.
[2023-03-22; Reflector poll]
Set priority to 3 after reflector poll.
"Proposed resolution is insufficient. A lot of the wording depends on the fact
that the range of widths of integer-class types and that of integer types are
disjoint. And it also disallows signed integer -> unsigned integer-class
conversion and by extension mixed ops, which is seriously breaking (e.g., it
x += 1)."
This wording is relative to N4928.
Modify 188.8.131.52 [iterator.concept.winc] as indicated:
-3- The range of representable values of an integer-class type is the continuous set of values over which it is defined. For any integer-class type, its range of representable values is either -2N-1 to 2N-1 - 1 (inclusive) for some integer N, in which case it is a signed-integer-class type, or 0 to 2N - 1 (inclusive) for some integer N, in which case it is an unsigned-integer-class type. In both cases, N is called the width of the integer-class type. The width of an integer-class type is greater than that of every integral type of the same signedness.[…] -6- Expressions of integer-class type are explicitly convertible to any integer-like type, and implicitly convertible to any integer-class type of equal or greater width and the same signedness. Expressions of integral type are
both implicitly andexplicitly convertible to any integer-class type. Conversions between integral and integer-class types and between two integer-class types do not exit via an exception. The result of such a conversion is the unique value of the destination type that is congruent to the source modulo 2N, where N is the width of the destination type.