mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
Replace the O(n) definitions using __is_one_of with constant-time checks that look for a static member in the __is_integral_helper class template. That class template is already specialized for every signed and unsigned integer type, so we don't need to define any additional specializations. We can just add a static data member that says whether the type is a signed integer type, an unsigned integer type, or neither. The __is_signed_integer and __is_unsigned_integer traits can then inspect that value. The new enum type could be extended in future to distinguish the character types (char, wchar_t, char8_t, char16_t, and char32_t) and bool from non-integer types, but that isn't needed for now. libstdc++-v3/ChangeLog: * include/std/type_traits (_Integer_kind): New enum type. (__is_integral_helper::_S_kind): New static data member in primary template and each explicit specialization. (__is_signed_integer, __is_unsigned_integer): Use _S_kind instead of O(n) disjunction with is_same. Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.