From 8c2e15aed558d451909d817a5bccbb2698025eb8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 12 Dec 2018 16:07:54 -0800 Subject: [PATCH] Make printf work in search (#164) --- include/fmt/printf.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 005df5f1..7804b953 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -192,8 +192,16 @@ class printf_width_handler: public function { return 0; } }; + +template +void printf(basic_buffer &buf, basic_string_view format, + basic_format_args args) { + Context(std::back_inserter(buf), format, args).format(); +} } // namespace internal +using internal::printf; // For printing into memory_buffer. + template class printf_arg_formatter; @@ -566,12 +574,6 @@ void basic_printf_context::format() { buffer.append(pointer_from(start), pointer_from(it)); } -template -void printf(internal::basic_buffer &buf, basic_string_view format, - basic_format_args args) { - Context(std::back_inserter(buf), format, args).format(); -} - template struct basic_printf_context_t { typedef basic_printf_context<