diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 2e5a8e68..076a78b8 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -419,6 +419,15 @@ template using maybe_const_range = conditional_t::value, const R, R>; +// Workaround a bug in MSVC 2015 and earlier. +#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910 +template +struct is_formattable_delayed + : disjunction< + is_formattable>, Char>, + has_fallback_formatter>, Char>> {}; +#endif + } // namespace detail template @@ -582,19 +591,14 @@ struct range_format_kind template struct formatter< R, Char, - enable_if_t::value != - range_format::disabled> -// Workaround a bug in MSVC 2017 and earlier. -#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1920 - , - disjunction< - is_formattable>, - Char>, - detail::has_fallback_formatter< - detail::uncvref_type>, Char>> + enable_if_t::value != + range_format::disabled> +// Workaround a bug in MSVC 2015 and earlier. +#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910 + , + detail::is_formattable_delayed #endif - >::value>> + >::value>> : detail::range_default_formatter::value, R, Char> { };