[committed] libstdc++: Make __int128 meet integer-class requirements [PR 96042]

Marc Glisse marc.glisse@inria.fr
Sat Aug 22 09:50:34 GMT 2020


On Wed, 19 Aug 2020, Jonathan Wakely via Gcc-patches wrote:

> Because __int128 can be used as the difference type for iota_view, we
> need to ensure that it meets the requirements of an integer-class type.
> The requirements in [iterator.concept.winc] p10 include numeric_limits
> being specialized and giving meaningful answers. Currently we only
> specialize numeric_limits for non-standard integer types in non-strict
> modes.  However, nothing prevents us from defining an explicit
> specialization for any implementation-defined type, so it doesn't matter
> whether std::is_integral<__int128> is true or not.
>
> This patch ensures that the numeric_limits specializations for signed
> and unsigned __int128 are defined whenever __int128 is available. It
> also makes the __numeric_traits and __int_limits helpers work for
> __int128, via a new __gnu_cxx::__is_integer_nonstrict trait.

Hello,

is there a particular reason to handle only __int128 this way, and not all 
the non-standard integer types? It looks like it would be a bit simpler to 
avoid a special case.

-- 
Marc Glisse


More information about the Gcc-patches mailing list