-
- Downloads
libstdc++: Disable std::formatter<char8_t, C> specialization
I noticed that char8_t was missing from the list of types that were prevented from using the std::formatter partial specialization for integer types. That partial specialization was also matching cv-qualified integer types, because std::integral<const int> is true. This change simplifies the constraints by introducing a new variable template which is only true for cv-unqualified integer types, with explicit specializations to exclude the character types. This should be slightly more efficient than the previous constraints that checked std::integral<T> and (!__is_one_of<T, char, wchar_t, ...>). It also avoids the need for a separate std::formatter specialization for 128-bit integers, as they can be handled by the new variable template too. libstdc++-v3/ChangeLog: * include/std/format (__format::__is_formattable_integer): New variable template and specializations. (template<integral, __char> struct formatter): Replace constraints on first arg with __is_formattable_integer. * testsuite/std/format/formatter/requirements.cc: Check that std::formatter specializations for char8_t and const int are disabled.
Loading
Please register or sign in to comment