summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarkus Mittendrein <maxmitti@maxmitti.tk>2022-01-07 22:59:07 +0100
committerMarkus Mittendrein <maxmitti@maxmitti.tk>2022-01-07 22:59:07 +0100
commit93fb22c69728beba9b3d1eecd16fc7a32d1da8d4 (patch)
treec25bf4d3a997c4065151aff51852f73b49bd836a /include
parentcb71e001e5088e9006c00634ce833f5659af855c (diff)
downloadcxxformat-93fb22c69728beba9b3d1eecd16fc7a32d1da8d4.tar.gz
cxxformat-93fb22c69728beba9b3d1eecd16fc7a32d1da8d4.zip
Fix perfect forwarding
Diffstat (limited to 'include')
-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);
};
(([&]{