diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 567303d3..f996d43d 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -11,6 +11,7 @@ #include #include "format.h" +#include "xchar.h" FMT_BEGIN_NAMESPACE @@ -115,7 +116,8 @@ struct fallback_formatter::value>> FMT_MODULE_EXPORT template -void vprint(std::basic_ostream& os, basic_string_view format_str, +void vprint(std::basic_ostream& os, + basic_string_view> format_str, basic_format_args>> args) { auto buffer = basic_memory_buffer(); detail::vformat_to(buffer, format_str, args); @@ -132,12 +134,17 @@ void vprint(std::basic_ostream& os, basic_string_view format_str, \endrst */ FMT_MODULE_EXPORT -template ::value, char_t>> -void print(std::basic_ostream& os, const S& format_str, Args&&... args) { - vprint(os, to_string_view(format_str), - fmt::make_format_args>(args...)); +template +void print(std::ostream& os, format_string fmt, Args&&... args) { + vprint(os, fmt, fmt::make_format_args(args...)); } + +FMT_MODULE_EXPORT +template +void print(std::wostream& os, wformat_string fmt, Args&&... args) { + vprint(os, fmt, fmt::make_wformat_args(args...)); +} + FMT_END_NAMESPACE #endif // FMT_OSTREAM_H_