summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/cxxformat/core.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/cxxformat/core.hpp b/include/cxxformat/core.hpp
index 993060d..048b3c9 100644
--- a/include/cxxformat/core.hpp
+++ b/include/cxxformat/core.hpp
@@ -466,15 +466,16 @@ namespace format {
precision = nth_argument<*spec.precision>(std::forward<Args>(args)...);
}
- auto&& arg = nth_argument<spec.argIndex>(std::forward<Args>(args)...);
- using formatter = formatter_with_fallback<std::decay_t<decltype(arg)>>;
+ using Arg = nth_type<spec.argIndex, Args...>;
+ Arg&& arg = nth_argument<spec.argIndex>(std::forward<Args>(args)...);
+ using formatter = formatter_with_fallback<std::decay_t<Arg>>;
[]() consteval {
// throws on error
formatter::conversionSupported(spec);
}();
- return formatter::format(out, arg, spec, minWidth, precision);
+ return formatter::format(out, std::forward<Arg>(arg), spec, minWidth, precision);
};
(([&]{