]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Replace __int_limits with __numeric_traits_integer
authorJonathan Wakely <jwakely@redhat.com>
Tue, 7 Jul 2020 22:26:38 +0000 (23:26 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 7 Jul 2020 22:36:29 +0000 (23:36 +0100)
commiteb04805be4029716e76532babc0fa9ecb18de96e
tree2a687b02ebaf35e79aa22184e9d39e1b7b9e9156
parent9ca8fefeb720c8a9dec58e9a99042e6727309251
libstdc++: Replace __int_limits with __numeric_traits_integer

I recently added std::__detail::__int_limits as a lightweight
alternative to std::numeric_limits, forgetting that the values it
provides (digits, min and max) are already provided by
__gnu_cxx::__numeric_traits.

This change adds __int_traits as an alias for __numeric_traits_integer.
This avoids instantiating __numeric_traits to decide whether to use
__numeric_traits_integer or __numeric_traits_floating. Then all uses of
__int_limits can be replaced with __int_traits, and __int_limits can be
removed.

libstdc++-v3/ChangeLog:

* include/Makefile.am: Remove bits/int_limits.h.
* include/Makefile.in: Regenerate.
* include/bits/int_limits.h: Removed.
* include/bits/parse_numbers.h (_Select_int_base): Replace
__int_limits with __int_traits.
* include/bits/range_access.h (_SSize::operator()): Likewise.
* include/ext/numeric_traits.h (__numeric_traits_integer): Add
static assertion.
(__int_traits): New alias template.
* include/std/bit (__rotl, __rotr, __countl_zero, __countl_one)
(__countr_zero, __countr_one, __popcount, __bit_ceil)
(__bit_floor, __bit_width) Replace __int_limits with
__int_traits.
* include/std/charconv (__to_chars_8, __from_chars_binary)
(__from_chars_alpha_to_num, from_chars): Likewise.
* include/std/memory_resource (polymorphic_allocator::allocate)
(polymorphic_allocator::allocate_object): Likewise.
* include/std/string_view (basic_string_view::_S_compare):
Likewise.
* include/std/utility (cmp_equal, cmp_less, in_range): Likewise.
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/int_limits.h [deleted file]
libstdc++-v3/include/bits/parse_numbers.h
libstdc++-v3/include/bits/range_access.h
libstdc++-v3/include/ext/numeric_traits.h
libstdc++-v3/include/std/bit
libstdc++-v3/include/std/charconv
libstdc++-v3/include/std/memory_resource
libstdc++-v3/include/std/string_view
libstdc++-v3/include/std/utility