Fix an inconsistentcy between to_string and format

This commit is contained in:
Victor Zverovich
2023-10-28 08:05:11 -07:00
parent 2a2c6e676f
commit 19276d7325
2 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -3751,8 +3751,11 @@ template <typename Char, typename OutputIt, typename T,
FMT_CONSTEXPR auto write(OutputIt out, const T& value)
-> enable_if_t<mapped_type_constant<T, Context>::value == type::custom_type,
OutputIt> {
auto formatter = typename Context::template formatter_type<T>();
auto parse_ctx = typename Context::parse_context_type({});
formatter.parse(parse_ctx);
auto ctx = Context(out, {}, {});
return typename Context::template formatter_type<T>().format(value, ctx);
return formatter.format(value, ctx);
}
// An argument visitor that formats the argument and writes it via the output