diff --git a/include/fmt/core.h b/include/fmt/core.h index df45a5b9..4c319647 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1541,8 +1541,7 @@ constexpr auto encode_types() -> unsigned long long { template FMT_CONSTEXPR FMT_INLINE auto make_arg(T& val) -> value { - auto&& arg = arg_mapper().map(val); - using arg_type = remove_cvref_t; + using arg_type = remove_cvref_t().map(val))>; constexpr bool formattable_char = !std::is_same::value; @@ -1561,7 +1560,7 @@ FMT_CONSTEXPR FMT_INLINE auto make_arg(T& val) -> value { formattable, "Cannot format an argument. To make type T formattable provide a " "formatter specialization: https://fmt.dev/latest/api.html#udt"); - return {arg}; + return {arg_mapper().map(val)}; } template