Skip to content

Commit 8c2e15a

Browse files
committed
Make printf work in search (fmtlib#164)
1 parent de71db6 commit 8c2e15a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

include/fmt/printf.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,16 @@ class printf_width_handler: public function<unsigned> {
192192
return 0;
193193
}
194194
};
195+
196+
template <typename Char, typename Context>
197+
void printf(basic_buffer<Char> &buf, basic_string_view<Char> format,
198+
basic_format_args<Context> args) {
199+
Context(std::back_inserter(buf), format, args).format();
200+
}
195201
} // namespace internal
196202

203+
using internal::printf; // For printing into memory_buffer.
204+
197205
template <typename Range>
198206
class printf_arg_formatter;
199207

@@ -566,12 +574,6 @@ void basic_printf_context<OutputIt, Char, AF>::format() {
566574
buffer.append(pointer_from(start), pointer_from(it));
567575
}
568576

569-
template <typename Char, typename Context>
570-
void printf(internal::basic_buffer<Char> &buf, basic_string_view<Char> format,
571-
basic_format_args<Context> args) {
572-
Context(std::back_inserter(buf), format, args).format();
573-
}
574-
575577
template <typename Buffer>
576578
struct basic_printf_context_t {
577579
typedef basic_printf_context<

0 commit comments

Comments
 (0)