From 02537548f3a9efb5f3b83755acf50c8a16ba58c8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 4 Oct 2024 17:15:07 -0700 Subject: [PATCH] Cleanup an example --- doc/api.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/api.md b/doc/api.md index 40b2b40363b1..d6532a03a702 100644 --- a/doc/api.md +++ b/doc/api.md @@ -375,18 +375,17 @@ allocator: using custom_string = std::basic_string, custom_allocator>; - custom_string vformat(custom_allocator alloc, fmt::string_view format_str, - fmt::format_args args) { + auto vformat(custom_allocator alloc, fmt::string_view fmt, + fmt::format_args args) -> custom_string { auto buf = custom_memory_buffer(alloc); - fmt::vformat_to(std::back_inserter(buf), format_str, args); + fmt::vformat_to(std::back_inserter(buf), fmt, args); return custom_string(buf.data(), buf.size(), alloc); } template - inline custom_string format(custom_allocator alloc, - fmt::string_view format_str, - const Args& ... args) { - return vformat(alloc, format_str, fmt::make_format_args(args...)); + auto format(custom_allocator alloc, fmt::string_view fmt, + const Args& ... args) -> custom_string { + return vformat(alloc, fmt, fmt::make_format_args(args...)); } The allocator will be used for the output container only. Formatting