Add to_char_type function to custom char_traits
This commit is contained in:
parent
6c83919adb
commit
543158bbf3
@ -199,12 +199,17 @@ struct char_traits<unsigned char> : std::char_traits<char>
|
||||
using int_type = uint64_t;
|
||||
|
||||
// Redefine to_int_type function
|
||||
static int_type to_int_type(char_type c)
|
||||
static int_type to_int_type(char_type c) noexcept
|
||||
{
|
||||
return static_cast<int_type>(c);
|
||||
}
|
||||
|
||||
static constexpr int_type eof()
|
||||
static char_type to_char_type(int_type i) noexcept
|
||||
{
|
||||
return static_cast<char_type>(i);
|
||||
}
|
||||
|
||||
static constexpr int_type eof() noexcept
|
||||
{
|
||||
return static_cast<int_type>(EOF);
|
||||
}
|
||||
@ -218,12 +223,17 @@ struct char_traits<signed char> : std::char_traits<char>
|
||||
using int_type = uint64_t;
|
||||
|
||||
// Redefine to_int_type function
|
||||
static int_type to_int_type(char_type c)
|
||||
static int_type to_int_type(char_type c) noexcept
|
||||
{
|
||||
return static_cast<int_type>(c);
|
||||
}
|
||||
|
||||
static constexpr int_type eof()
|
||||
static char_type to_char_type(int_type i) noexcept
|
||||
{
|
||||
return static_cast<char_type>(i);
|
||||
}
|
||||
|
||||
static constexpr int_type eof() noexcept
|
||||
{
|
||||
return static_cast<int_type>(EOF);
|
||||
}
|
||||
|
||||
@ -3612,12 +3612,17 @@ struct char_traits<unsigned char> : std::char_traits<char>
|
||||
using int_type = uint64_t;
|
||||
|
||||
// Redefine to_int_type function
|
||||
static int_type to_int_type(char_type c)
|
||||
static int_type to_int_type(char_type c) noexcept
|
||||
{
|
||||
return static_cast<int_type>(c);
|
||||
}
|
||||
|
||||
static constexpr int_type eof()
|
||||
static char_type to_char_type(int_type i) noexcept
|
||||
{
|
||||
return static_cast<char_type>(i);
|
||||
}
|
||||
|
||||
static constexpr int_type eof() noexcept
|
||||
{
|
||||
return static_cast<int_type>(EOF);
|
||||
}
|
||||
@ -3631,12 +3636,17 @@ struct char_traits<signed char> : std::char_traits<char>
|
||||
using int_type = uint64_t;
|
||||
|
||||
// Redefine to_int_type function
|
||||
static int_type to_int_type(char_type c)
|
||||
static int_type to_int_type(char_type c) noexcept
|
||||
{
|
||||
return static_cast<int_type>(c);
|
||||
}
|
||||
|
||||
static constexpr int_type eof()
|
||||
static char_type to_char_type(int_type i) noexcept
|
||||
{
|
||||
return static_cast<char_type>(i);
|
||||
}
|
||||
|
||||
static constexpr int_type eof() noexcept
|
||||
{
|
||||
return static_cast<int_type>(EOF);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user