From 417b35b5b3a25c779a33417806fd389cdd4fea68 Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Fri, 25 Dec 2020 21:45:58 +0300 Subject: [PATCH] workaround MSVC bug --- include/fmt/format.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 42f0bdac..68ca2e56 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2111,12 +2111,14 @@ FMT_CONSTEXPR OutputIt write(OutputIt out, T value) { return base_iterator(out, it); } +// FMT_ENABLE_IF() condition separated to workaround MSVC bug template < typename Char, typename OutputIt, typename T, - FMT_ENABLE_IF( + bool check = std::is_enum::value && !std::is_same::value && mapped_type_constant>::value != - type::custom_type)> + type::custom_type, + FMT_ENABLE_IF(check)> FMT_CONSTEXPR OutputIt write(OutputIt out, T value) { return write( out, static_cast::type>(value));