Fix signed char char traits

This commit is contained in:
Colby Haskell 2023-11-05 11:21:06 -05:00
parent 283d547686
commit 6f703ac334
2 changed files with 24 additions and 0 deletions

View File

@ -162,6 +162,18 @@ template<>
struct char_traits<signed char> : std::char_traits<char> struct char_traits<signed char> : std::char_traits<char>
{ {
using char_type = signed char; using char_type = signed char;
using int_type = unsigned long;
// Redefine to_int_type function
static int_type to_int_type(char_type c)
{
return static_cast<int_type>(c);
}
static int_type eof()
{
return static_cast<int_type>(EOF);
}
}; };
// General-purpose iterator-based adapter. It might not be as fast as // General-purpose iterator-based adapter. It might not be as fast as

View File

@ -6245,6 +6245,18 @@ template<>
struct char_traits<signed char> : std::char_traits<char> struct char_traits<signed char> : std::char_traits<char>
{ {
using char_type = signed char; using char_type = signed char;
using int_type = unsigned long;
// Redefine to_int_type function
static int_type to_int_type(char_type c)
{
return static_cast<int_type>(c);
}
static int_type eof()
{
return static_cast<int_type>(EOF);
}
}; };
// General-purpose iterator-based adapter. It might not be as fast as // General-purpose iterator-based adapter. It might not be as fast as