diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index e467f1ae..186a7d84 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -141,16 +141,12 @@ inline void vprint(std::basic_ostream &os, fmt::print(cerr, "Don't {}!", "panic"); \endrst */ -template -inline void print(std::ostream &os, string_view format_str, - const Args & ... args) { - vprint(os, format_str, make_format_args(args...)); -} - -template -inline void print(std::wostream &os, wstring_view format_str, - const Args & ... args) { - vprint(os, format_str, make_format_args(args...)); +template +inline typename std::enable_if::value>::type +print(std::basic_ostream &os, const S &format_str, + const Args & ... args) { + internal::checked_args ca(format_str, args...); + vprint(os, internal::to_string_view(format_str), *ca); } FMT_END_NAMESPACE