From 91481f255cf6b61a14637ca9a750883301d12b27 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 26 Aug 2022 15:45:00 -0700 Subject: [PATCH] Detemplatize code_point_length_impl --- include/fmt/core.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 930b6bb6..1fc0292e 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2297,16 +2297,15 @@ constexpr auto to_ascii(Char c) -> underlying_t { return c; } -template -FMT_CONSTEXPR auto code_point_length_impl(Char begin) -> int { +FMT_CONSTEXPR inline auto code_point_length_impl(char c) -> int { return "\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\0\0\0\0\0\0\0\0\2\2\2\2\3\3\4" - [static_cast(begin) >> 3]; + [static_cast(c) >> 3]; } template FMT_CONSTEXPR auto code_point_length(const Char* begin) -> int { if (const_check(sizeof(Char) != 1)) return 1; - int len = code_point_length_impl(*begin); + int len = code_point_length_impl(static_cast(*begin)); // Compute the pointer to the next character early so that the next // iteration can start working on the next character. Neither Clang