diff --git a/include/fmt/format.h b/include/fmt/format.h index e5bd8b11..e65e34aa 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -4290,8 +4290,13 @@ auto join(Range&& range, string_view sep) template ::value)> inline auto to_string(const T& value) -> std::string { auto buffer = memory_buffer(); - detail::write(appender(buffer), value); - return {buffer.data(), buffer.size()}; + if constexpr (is_scoped_enum::value){ + detail::write(appender(buffer), static_cast::type>(value)); + return {buffer.data(), buffer.size()}; + }else{ + detail::write(appender(buffer), value); + return {buffer.data(), buffer.size()}; + } } template ::value)>