From 7645ca072480a374cb467907fd29a92f9a1287a7 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 11 Apr 2020 06:42:15 -0700 Subject: [PATCH] Clean up printf --- include/fmt/printf.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/include/fmt/printf.h b/include/fmt/printf.h index a7902280..bfbaa047 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -172,20 +172,20 @@ template class printf_width_handler { }; template -void printf(buffer& buf, basic_string_view format, - basic_format_args args) { +void vprintf(buffer& buf, basic_string_view format, + basic_format_args args) { Context(std::back_inserter(buf), format, args).format(); } - -template -internal::truncating_iterator printf( - internal::truncating_iterator it, basic_string_view format, - basic_format_args args) { - return Context(it, format, args).format(); -} } // namespace internal -using internal::printf; // For printing into memory_buffer. +// For printing into memory_buffer. +template +FMT_DEPRECATED void printf(internal::buffer& buf, + basic_string_view format, + basic_format_args args) { + return internal::vprintf(buf, format, args); +} +using internal::vprintf; template class printf_arg_formatter; @@ -605,7 +605,7 @@ inline std::basic_string vsprintf( const S& format, basic_format_args>> args) { basic_memory_buffer buffer; - printf(buffer, to_string_view(format), args); + vprintf(buffer, to_string_view(format), args); return to_string(buffer); } @@ -630,7 +630,7 @@ inline int vfprintf( std::FILE* f, const S& format, basic_format_args>> args) { basic_memory_buffer buffer; - printf(buffer, to_string_view(format), args); + vprintf(buffer, to_string_view(format), args); std::size_t size = buffer.size(); return std::fwrite(buffer.data(), sizeof(Char), size, f) < size ? -1 @@ -683,7 +683,7 @@ inline int vfprintf( std::basic_ostream& os, const S& format, basic_format_args>> args) { basic_memory_buffer buffer; - printf(buffer, to_string_view(format), args); + vprintf(buffer, to_string_view(format), args); internal::write(os, buffer); return static_cast(buffer.size()); }