From e8bd2a804d0ffc5ba8108f8a7b94b4074c6e5fd2 Mon Sep 17 00:00:00 2001 From: Jonathan W Date: Thu, 23 Jun 2022 17:24:11 +0200 Subject: [PATCH] Fix enable_ifs for map formatter (#2944) --- include/fmt/ranges.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 4f65eb4b..c5619922 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -269,6 +269,14 @@ using range_reference_type = template using uncvref_type = remove_cvref_t>; +template +using uncvref_first_type = remove_cvref_t< + decltype(std::declval>().first)>; + +template +using uncvref_second_type = remove_cvref_t< + decltype(std::declval>().second)>; + template OutputIt write_delimiter(OutputIt out) { *out++ = ','; *out++ = ' '; @@ -452,11 +460,12 @@ struct formatter< enable_if_t::value // Workaround a bug in MSVC 2019 and earlier. #if !FMT_MSC_VERSION - && (is_formattable, Char>::value || - detail::has_fallback_formatter, - Char>::value) + && (is_formattable, Char>::value || + detail::has_fallback_formatter, Char>::value) + && (is_formattable, Char>::value || + detail::has_fallback_formatter, Char>::value) #endif - >> { + >> { template FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { return ctx.begin();