3376. "integer-like class type" is too restrictive

Section: [iterator.concept.winc] Status: Resolved Submitter: Jonathan Wakely Opened: 2020-01-16 Last modified: 2021-10-23 03:11:13 UTC

Priority: 3

View all other issues in [iterator.concept.winc].

View all issues with Resolved status.

Discussion: [iterator.concept.winc] says:

A type I is an integer-class type if it is in a set of implementation-defined class types that behave as integer types do, as defined in below.


A type I is integer-like if it models integral<I> or if it is an integer-class type.

Some implementations support built-in integer types that do not necessarily model std::integral, e.g. with libstdc++ whether std::is_integral_v<__int128> is true depends whether "strict" or "extensions" mode is in use. Because __int128 is not a class type, it can't be used as an integer-like type in strict mode (which effectively means it can't be used at all, to avoid unwanted ABI differences between modes).

The requirement should be relaxed to permit non-class types which are integer-like but not one of the standard integer types (nor extended integer types). If we do that, the name "integer-like class type" should probably change.

[2020-02-08 Issue Prioritization]

Priority to 3 after reflector discussion.

[2021-10-23 Resolved by the adoption of P2393R1 at the October 2021 plenary. Status changed: New → Resolved.]

Proposed resolution: