From b5c4d25cd13209944b9a018c8a242377839fe510 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 24 Aug 2025 09:30:50 -0700 Subject: [PATCH] Rename is_char to is_code_unit --- include/fmt/base.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index a97c298a..38f9b523 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -903,24 +903,20 @@ FMT_END_EXPORT namespace detail { -// DEPRECATED! Will be merged with is_char -template struct is_xchar : std::false_type {}; -template <> struct is_xchar : std::true_type {}; -template <> struct is_xchar : std::true_type {}; -template <> struct is_xchar : std::true_type {}; +// Specifies if `T` is a code unit type. +template struct is_code_unit : std::false_type {}; +template <> struct is_code_unit : std::true_type {}; +template <> struct is_code_unit : std::true_type {}; +template <> struct is_code_unit : std::true_type {}; +template <> struct is_code_unit : std::true_type {}; #ifdef __cpp_char8_t -template <> -struct is_xchar : bool_constant {}; +template <> struct is_code_unit : bool_constant {}; #endif -// Specifies if `T` is a character (code unit) type. -template struct is_char : is_xchar {}; -template <> struct is_char : std::true_type {}; - // Constructs fmt::basic_string_view from types implicitly convertible // to it, deducing Char. Explicitly convertible types such as the ones returned // from FMT_STRING are intentionally excluded. -template ::value)> +template ::value)> constexpr auto to_string_view(const Char* s) -> basic_string_view { return s; } @@ -1165,7 +1161,7 @@ template struct type_mapper { static auto map(ubitint) -> conditional_t; - template ::value)> + template ::value)> static auto map(T) -> conditional_t< std::is_same::value || std::is_same::value, Char, void>; @@ -2185,7 +2181,7 @@ template class value { static_assert(N <= 64, "unsupported _BitInt"); } - template ::value)> + template ::value)> constexpr FMT_INLINE value(T x FMT_BUILTIN) : char_value(x) { static_assert( std::is_same::value || std::is_same::value,