diff --git a/include/fmt/core.h b/include/fmt/core.h index 3a608ef7..cb0ec968 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2132,11 +2132,8 @@ struct dynamic_format_specs : format_specs<Char> { }; // Converts a character to ASCII. Returns '\0' on conversion failure. -template <typename Char, FMT_ENABLE_IF(std::is_integral<Char>::value)> -constexpr auto to_ascii(Char c) -> char { - return c <= 0xff ? static_cast<char>(c) : '\0'; -} -template <typename Char, FMT_ENABLE_IF(std::is_enum<Char>::value)> +template <typename Char, FMT_ENABLE_IF(std::is_integral<Char>::value || + std::is_enum<Char>::value)> constexpr auto to_ascii(Char c) -> char { return c <= 0xff ? static_cast<char>(c) : '\0'; }