From fa49e152fbe18db0e7fed3b3003667ca72543394 Mon Sep 17 00:00:00 2001 From: Justin Riddell Date: Thu, 14 Nov 2024 08:04:41 +0000 Subject: [PATCH] Replace std::forward for clang-tidy Should fix #4231 --- include/fmt/ranges.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index b4076c43bf3f..ee3b747c475c 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -646,9 +646,9 @@ struct formatter, Char> { #endif formatter, Char> value_formatter_; - using view_ref = conditional_t::value, - const join_view&, - join_view&&>; + using view = conditional_t::value, + const join_view, + join_view>; public: using nonlocking = void; @@ -658,9 +658,10 @@ struct formatter, Char> { } template - auto format(view_ref& value, FormatContext& ctx) const - -> decltype(ctx.out()) { - auto it = std::forward(value).begin; + auto format(view& value, FormatContext& ctx) const -> decltype(ctx.out()) { + using iter = + conditional_t::value, It, It&>; + iter it = value.begin; auto out = ctx.out(); if (it == value.end) return out; out = value_formatter_.format(*it, ctx);