From 8793ca53e5dbcade50fbf281fe5ad99833cbaa95 Mon Sep 17 00:00:00 2001 From: Eduardo Gomez Saldias <50159560+edugomez102@users.noreply.github.com> Date: Tue, 28 Jul 2026 13:32:28 +0200 Subject: [PATCH] Move wide_cp_range struct into display_width_of() --- include/fmt/format.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 3c59dc62..7c19b90f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -655,13 +655,12 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) { } while (buf_ptr < buf + num_chars_left); } -struct wide_cp_range { - uint32_t first; - uint32_t last; -}; - inline auto display_width_of(uint32_t cp) noexcept -> size_t { if (cp < 0x1100) return 1; + struct wide_cp_range { + uint32_t first; + uint32_t last; + }; // Code points with display width 2: East Asian Wide/Fullwidth // (https://www.unicode.org/reports/tr11/) and Emoji_Presentation // (https://www.unicode.org/reports/tr51/) ranges, sorted and merged.