Move writer to PrintfFormatter object for consistency with BasicFormatter

This commit is contained in:
Victor Zverovich
2016-07-20 08:21:13 -07:00
parent 9823675832
commit ab054532ce
3 changed files with 19 additions and 20 deletions

View File

@@ -51,10 +51,10 @@ std::string custom_format(const char *format_str, fmt::ArgList args) {
}
FMT_VARIADIC(std::string, custom_format, const char *)
std::string custom_sprintf(const char* fstr, fmt::ArgList args){
std::string custom_sprintf(const char* format_str, fmt::ArgList args){
fmt::MemoryWriter writer;
fmt::PrintfFormatter<char, CustomPAF> pfer( args);
pfer.format(writer, fstr);
fmt::PrintfFormatter<char, CustomPAF> formatter(args, writer);
formatter.format(format_str);
return writer.str();
}
FMT_VARIADIC(std::string, custom_sprintf, const char*);