From 74ffea0dcfee4a06fb3e153bfb1f8e69c797681c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 1 Jan 2024 20:09:47 -0800 Subject: [PATCH] Simplify to_ascii --- include/fmt/core.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 { }; // Converts a character to ASCII. Returns '\0' on conversion failure. -template ::value)> -constexpr auto to_ascii(Char c) -> char { - return c <= 0xff ? static_cast(c) : '\0'; -} -template ::value)> +template ::value || + std::is_enum::value)> constexpr auto to_ascii(Char c) -> char { return c <= 0xff ? static_cast(c) : '\0'; }