Minor cleanup

This commit is contained in:
Victor Zverovich 2024-07-14 11:14:49 -07:00
parent 3541353512
commit f97deb0d7d

View File

@ -3969,9 +3969,8 @@ struct formatter<T, Char, enable_if_t<detail::has_format_as<T>::value>>
: formatter<detail::format_as_t<T>, Char> { : formatter<detail::format_as_t<T>, Char> {
template <typename FormatContext> template <typename FormatContext>
auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) { auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) {
using base = formatter<detail::format_as_t<T>, Char>;
auto&& val = format_as(value); // Make an lvalue reference for format. auto&& val = format_as(value); // Make an lvalue reference for format.
return base::format(val, ctx); return formatter<detail::format_as_t<T>, Char>::format(val, ctx);
} }
}; };
@ -3980,8 +3979,7 @@ struct formatter<T, Char, enable_if_t<detail::has_format_as<T>::value>>
struct formatter<Type, Char> : formatter<Base, Char> { \ struct formatter<Type, Char> : formatter<Base, Char> { \
template <typename FormatContext> \ template <typename FormatContext> \
auto format(Type value, FormatContext& ctx) const -> decltype(ctx.out()) { \ auto format(Type value, FormatContext& ctx) const -> decltype(ctx.out()) { \
using base = formatter<Base, Char>; \ return formatter<Base, Char>::format(value, ctx); \
return base::format(value, ctx); \
} \ } \
} }