From e2408f37c8f7301a1e5d32364675d0077ad09559 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 26 Mar 2022 09:36:06 -0700 Subject: [PATCH] Check if formatter is not defined if there is format_as --- include/fmt/core.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/fmt/core.h b/include/fmt/core.h index 18c9ae6c..4d83df79 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1440,6 +1440,7 @@ template struct arg_mapper { FMT_ENABLE_IF(std::is_enum::value&& std::is_integral::value)> FMT_CONSTEXPR FMT_INLINE auto map(const T& val) -> decltype(std::declval().map(U())) { + static_assert(!has_formatter::value, ""); return map(format_as(val)); }