Don't use deprecated API in docs

This commit is contained in:
Victor Zverovich 2021-07-10 13:42:51 -07:00
parent 8465869d7b
commit e41ac1f875
2 changed files with 4 additions and 4 deletions

View File

@ -350,8 +350,8 @@ allocator::
custom_string vformat(custom_allocator alloc, fmt::string_view format_str,
fmt::format_args args) {
custom_memory_buffer buf(alloc);
fmt::vformat_to(buf, format_str, args);
auto buf = custom_memory_buffer(alloc);
fmt::vformat_to(std::back_inserter(buf), format_str, args);
return custom_string(buf.data(), buf.size(), alloc);
}

View File

@ -607,8 +607,8 @@ enum { inline_buffer_size = 500 };
**Example**::
fmt::memory_buffer out;
format_to(out, "The answer is {}.", 42);
auto out = fmt::memory_buffer();
format_to(std::back_inserter(out), "The answer is {}.", 42);
This will append the following output to the ``out`` object: