From 4cc8b6f18ba2221cda38b98b04ddc559c059989f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kr=C3=BCgler?= Date: Sun, 3 Jul 2022 18:24:07 +0200 Subject: [PATCH] Remove workaround explicit specializations if the partial specialization would cause an ambiguity error --- include/fmt/std.h | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/include/fmt/std.h b/include/fmt/std.h index fe1c2c47..227f4841 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -58,6 +58,9 @@ inline void write_escaped_path( } // namespace detail #if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1920 +// For MSVC 2017 and earlier using the partial specialization +// would cause an ambiguity error, therefore we provide it only +// conditionally. template struct formatter : formatter> { @@ -70,32 +73,6 @@ struct formatter basic_string_view(quoted.data(), quoted.size()), ctx); } }; -#else -// Workaround for MSVC 2017 and earlier. -template <> -struct formatter - : formatter> { - template - auto format(const std::filesystem::path& p, FormatContext& ctx) const -> - typename FormatContext::iterator { - basic_memory_buffer quoted; - detail::write_escaped_path(quoted, p); - return formatter>::format( - basic_string_view(quoted.data(), quoted.size()), ctx); - } -}; -template <> -struct formatter - : formatter> { - template - auto format(const std::filesystem::path& p, FormatContext& ctx) const -> - typename FormatContext::iterator { - basic_memory_buffer quoted; - detail::write_escaped_path(quoted, p); - return formatter>::format( - basic_string_view(quoted.data(), quoted.size()), ctx); - } -}; #endif FMT_END_NAMESPACE #endif