diff --git a/README.md b/README.md index 5fa1320..eb43775 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ int main() { std::cerr << "parsing failure\n"; return EXIT_FAILURE; } - std::cout << "parsed the number "<< i << std::endl; + std::cout << "parsed the number " << i << std::endl; std::string binstr = "1001111000011001110110111001001010110100111000110001100"; @@ -158,7 +158,7 @@ int main() { std::cerr << "parsing failure\n"; return EXIT_FAILURE; } - std::cout << "parsed the number "<< i << std::endl; + std::cout << "parsed the number " << i << std::endl; std::string hexstr = "4f0cedc95a718c"; @@ -167,7 +167,7 @@ int main() { std::cerr << "parsing failure\n"; return EXIT_FAILURE; } - std::cout << "parsed the number "<< i << std::endl; + std::cout << "parsed the number " << i << std::endl; return EXIT_SUCCESS; } ``` diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 162dfbb..ebe7cfd 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -237,7 +237,12 @@ struct is_supported_char_type : std::integral_constant::value || std::is_same::value || std::is_same::value || - std::is_same::value> {}; + std::is_same::value +#ifdef __cpp_char8_t + || std::is_same::value +#endif + > { +}; // Compares two ASCII strings in a case insensitive manner. template @@ -748,6 +753,11 @@ template <> constexpr char16_t const *str_const_nan() { template <> constexpr char32_t const *str_const_nan() { return U"nan"; } +#ifdef __cpp_char8_t +template <> constexpr char8_t const *str_const_nan() { + return u8"nan"; +} +#endif template constexpr UC const *str_const_inf(); template <> constexpr char const *str_const_inf() { return "infinity"; } @@ -760,6 +770,11 @@ template <> constexpr char16_t const *str_const_inf() { template <> constexpr char32_t const *str_const_inf() { return U"infinity"; } +#ifdef __cpp_char8_t +template <> constexpr char8_t const *str_const_inf() { + return u8"infinity"; +} +#endif template struct int_luts { static constexpr uint8_t chdigit[] = {