diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index da9c65e0..34b8e96f 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -70,6 +70,8 @@ template struct streamed_view { }; } // namespace detail +FMT_BEGIN_EXPORT + // Formats an object of type T that has an overloaded ostream operator<<. template struct basic_ostream_formatter : formatter, Char> { @@ -147,7 +149,7 @@ inline void vprint(std::ostream& os, string_view fmt, format_args args) { * * fmt::print(cerr, "Don't {}!", "panic"); */ -FMT_EXPORT template +template void print(std::ostream& os, format_string fmt, T&&... args) { fmt::vargs vargs = {{args...}}; if FMT_CONSTEXPR20 (detail::use_utf8) return vprint(os, fmt.str, vargs); @@ -156,12 +158,14 @@ void print(std::ostream& os, format_string fmt, T&&... args) { detail::write_buffer(os, buffer); } -FMT_EXPORT template +template void println(std::ostream& os, format_string fmt, T&&... args) { fmt::print(os, FMT_STRING("{}\n"), fmt::format(fmt, std::forward(args)...)); } +FMT_END_EXPORT + FMT_END_NAMESPACE #endif // FMT_OSTREAM_H_