From 471dfa4f604d2506076d5b38b787e7a3c979e57c Mon Sep 17 00:00:00 2001 From: Egor Seredin Date: Thu, 29 Aug 2019 18:14:18 +0900 Subject: [PATCH] Map not int enum to correct underlying_type --- include/fmt/core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 2dc6ed55..cb7f6185 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -824,8 +824,8 @@ template struct arg_mapper { FMT_ENABLE_IF(std::is_enum::value && !has_formatter::value && !has_fallback_formatter::value)> - FMT_CONSTEXPR int map(const T& val) { - return static_cast(val); + FMT_CONSTEXPR auto map(const T& val) -> decltype(map(static_cast::type>(val))) { + return map(static_cast::type>(val)); } template ::value && !is_char::value &&