From b761f1279e2dfb950a7bf9ff7128d6b03b77b013 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 7 Jul 2022 16:48:17 -0700 Subject: [PATCH] =?UTF-8?q?Improve=20forward=20using=20the=20idea=20from?= =?UTF-8?q?=20Jonathan=20M=C3=BCller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/fmt/core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 30ef27e0..8bb73c71 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -201,7 +201,7 @@ #endif // An inline std::forward replacement. -#define FMT_FORWARD(T, value) static_cast(value) +#define FMT_FORWARD(...) static_cast(__VA_ARGS__) #ifdef _MSC_VER # define FMT_UNCHECKED_ITERATOR(It) \ @@ -1711,7 +1711,7 @@ constexpr auto encode_types() -> unsigned long long { template FMT_CONSTEXPR FMT_INLINE auto make_value(T&& val) -> value { - const auto& arg = arg_mapper().map(FMT_FORWARD(T, val)); + const auto& arg = arg_mapper().map(FMT_FORWARD(val)); constexpr bool formattable_char = !std::is_same::value; @@ -1878,7 +1878,7 @@ class format_arg_store data_{detail::make_arg< is_packed, Context, detail::mapped_type_constant, Context>::value>( - FMT_FORWARD(T, args))...} { + FMT_FORWARD(args))...} { detail::init_named_args(data_.named_args(), 0, 0, args...); } }; @@ -1894,7 +1894,7 @@ class format_arg_store template constexpr auto make_format_args(Args&&... args) -> format_arg_store...> { - return {FMT_FORWARD(Args, args)...}; + return {FMT_FORWARD(args)...}; } /**