diff --git a/include/fmt/core.h b/include/fmt/core.h index e17e0702..10ac2843 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -393,12 +393,6 @@ template constexpr bool is_unicode() { return FMT_UNICODE || sizeof(Char) != 1 || (sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5); } - -#ifdef __cpp_char8_t -using char8_type = char8_t; -#else -enum char8_type : unsigned char {}; -#endif } // namespace detail /** @@ -507,9 +501,6 @@ using wstring_view = basic_string_view; template struct is_char : std::false_type {}; template <> struct is_char : std::true_type {}; template <> struct is_char : std::true_type {}; -template <> struct is_char : std::true_type {}; -template <> struct is_char : std::true_type {}; -template <> struct is_char : std::true_type {}; /** \rst diff --git a/include/fmt/format.h b/include/fmt/format.h index 76fe1444..84a968cd 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -431,6 +431,12 @@ FMT_CONSTEXPR20 T* fill_n(T* out, Size count, char value) { return out + count; } +#ifdef __cpp_char8_t +using char8_type = char8_t; +#else +enum char8_type : unsigned char {}; +#endif + template using needs_conversion = bool_constant< std::is_same::value_type, @@ -634,6 +640,10 @@ void iterator_buffer::flush() { FMT_MODULE_EXPORT_BEGIN +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; + // The number of characters to store in the basic_memory_buffer object itself // to avoid dynamic memory allocation. enum { inline_buffer_size = 500 };