diff --git a/include/fmt/wchar.h b/include/fmt/wchar.h index 72b05e22..91f3bb3a 100644 --- a/include/fmt/wchar.h +++ b/include/fmt/wchar.h @@ -13,6 +13,11 @@ #include "format.h" FMT_BEGIN_NAMESPACE +namespace detail { +template +using is_exotic_char = bool_constant::value>; +} + FMT_MODULE_EXPORT_BEGIN using wstring_view = basic_string_view; @@ -65,8 +70,8 @@ arg_join join(std::initializer_list list, } template , - FMT_ENABLE_IF(detail::is_locale::value && - !std::is_same::value)> + FMT_ENABLE_IF(detail::is_locale::value&& + detail::is_exotic_char::value)> inline std::basic_string vformat( const Locale& loc, const S& format_str, basic_format_args>> args) { @@ -75,8 +80,8 @@ inline std::basic_string vformat( template , - FMT_ENABLE_IF(detail::is_locale::value && - !std::is_same::value)> + FMT_ENABLE_IF(detail::is_locale::value&& + detail::is_exotic_char::value)> inline std::basic_string format(const Locale& loc, const S& format_str, Args&&... args) { return detail::vformat(loc, to_string_view(format_str), @@ -86,8 +91,8 @@ inline std::basic_string format(const Locale& loc, const S& format_str, template , FMT_ENABLE_IF(detail::is_output_iterator::value&& - detail::is_locale::value && - !std::is_same::value)> + detail::is_locale::value&& + detail::is_exotic_char::value)> inline OutputIt vformat_to( OutputIt out, const Locale& loc, const S& format_str, basic_format_args>> args) { @@ -96,11 +101,11 @@ inline OutputIt vformat_to( return detail::get_iterator(buf); } -template , - bool enable = detail::is_output_iterator::value&& - detail::is_locale::value && - !std::is_same::value> +template < + typename OutputIt, typename Locale, typename S, typename... Args, + typename Char = char_t, + bool enable = detail::is_output_iterator::value&& + detail::is_locale::value&& detail::is_exotic_char::value> inline auto format_to(OutputIt out, const Locale& loc, const S& format_str, Args&&... args) -> typename std::enable_if::type {