Fix an inconsistentcy between to_string and format
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user