mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-27 12:49:46 +01:00
Move generic format functions to format.h
This commit is contained in:
@@ -2575,14 +2575,14 @@ FMT_FUNC void report_system_error(int error_code,
|
||||
report_error(format_system_error, error_code, message);
|
||||
}
|
||||
|
||||
FMT_FUNC std::string detail::vformat(string_view format_str, format_args args) {
|
||||
if (format_str.size() == 2 && equal2(format_str.data(), "{}")) {
|
||||
FMT_FUNC std::string vformat(string_view fmt, format_args args) {
|
||||
if (fmt.size() == 2 && detail::equal2(fmt.data(), "{}")) {
|
||||
auto arg = args.get(0);
|
||||
if (!arg) error_handler().on_error("argument not found");
|
||||
return visit_format_arg(stringifier(), arg);
|
||||
if (!arg) detail::error_handler().on_error("argument not found");
|
||||
return visit_format_arg(detail::stringifier(), arg);
|
||||
}
|
||||
memory_buffer buffer;
|
||||
detail::vformat_to(buffer, format_str, args);
|
||||
detail::vformat_to(buffer, fmt, args);
|
||||
return to_string(buffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user