mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
Merge pull request #289 from dalle/issue288-char8-support
Support char8_t on C++20
This commit is contained in:
commit
6801b0ca20
@ -237,7 +237,12 @@ struct is_supported_char_type
|
|||||||
: std::integral_constant<bool, std::is_same<UC, char>::value ||
|
: std::integral_constant<bool, std::is_same<UC, char>::value ||
|
||||||
std::is_same<UC, wchar_t>::value ||
|
std::is_same<UC, wchar_t>::value ||
|
||||||
std::is_same<UC, char16_t>::value ||
|
std::is_same<UC, char16_t>::value ||
|
||||||
std::is_same<UC, char32_t>::value> {};
|
std::is_same<UC, char32_t>::value
|
||||||
|
#ifdef __cpp_char8_t
|
||||||
|
|| std::is_same<UC, char8_t>::value
|
||||||
|
#endif
|
||||||
|
> {
|
||||||
|
};
|
||||||
|
|
||||||
// Compares two ASCII strings in a case insensitive manner.
|
// Compares two ASCII strings in a case insensitive manner.
|
||||||
template <typename UC>
|
template <typename UC>
|
||||||
@ -748,6 +753,11 @@ template <> constexpr char16_t const *str_const_nan<char16_t>() {
|
|||||||
template <> constexpr char32_t const *str_const_nan<char32_t>() {
|
template <> constexpr char32_t const *str_const_nan<char32_t>() {
|
||||||
return U"nan";
|
return U"nan";
|
||||||
}
|
}
|
||||||
|
#ifdef __cpp_char8_t
|
||||||
|
template <> constexpr char8_t const *str_const_nan<char8_t>() {
|
||||||
|
return u8"nan";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename UC> constexpr UC const *str_const_inf();
|
template <typename UC> constexpr UC const *str_const_inf();
|
||||||
template <> constexpr char const *str_const_inf<char>() { return "infinity"; }
|
template <> constexpr char const *str_const_inf<char>() { return "infinity"; }
|
||||||
@ -760,6 +770,11 @@ template <> constexpr char16_t const *str_const_inf<char16_t>() {
|
|||||||
template <> constexpr char32_t const *str_const_inf<char32_t>() {
|
template <> constexpr char32_t const *str_const_inf<char32_t>() {
|
||||||
return U"infinity";
|
return U"infinity";
|
||||||
}
|
}
|
||||||
|
#ifdef __cpp_char8_t
|
||||||
|
template <> constexpr char8_t const *str_const_inf<char8_t>() {
|
||||||
|
return u8"infinity";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename = void> struct int_luts {
|
template <typename = void> struct int_luts {
|
||||||
static constexpr uint8_t chdigit[] = {
|
static constexpr uint8_t chdigit[] = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user