Move generic format functions to format.h

This commit is contained in:
Victor Zverovich
2021-05-18 19:01:43 -07:00
parent 9a92eb4158
commit 21d93bfd33
5 changed files with 187 additions and 154 deletions
+5 -6
View File
@@ -432,13 +432,12 @@ class ostream final : private detail::buffer<char> {
}
/**
Formats ``args`` according to specifications in ``format_str`` and writes
the output to the file.
Formats ``args`` according to specifications in ``fmt`` and writes the
output to the file.
*/
template <typename S, typename... Args>
void print(const S& format_str, Args&&... args) {
format_to(detail::buffer_appender<char>(*this), format_str,
std::forward<Args>(args)...);
template <typename... T> void print(format_string<T...> fmt, T&&... args) {
vformat_to(detail::buffer_appender<char>(*this), fmt,
make_format_args(args...));
}
};