Skip to content

Commit

Permalink
Replace std::forward for clang-tidy
Browse files Browse the repository at this point in the history
Should fix #4231
Could instead use:
<!std::is_copy_constructible_v<It>, It&, It>;
  • Loading branch information
Arghnews committed Nov 12, 2024
1 parent a6c45df commit 03e1128
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ struct formatter<join_view<It, Sentinel, Char>, Char> {
template <typename FormatContext>
auto format(view_ref& value, FormatContext& ctx) const
-> decltype(ctx.out()) {
auto it = std::forward<view_ref>(value).begin;
using iter =
conditional_t<std::is_rvalue_reference<view_ref>::value, It&, It>;
iter it = value.begin;
auto out = ctx.out();
if (it == value.end) return out;
out = value_formatter_.format(*it, ctx);
Expand Down

0 comments on commit 03e1128

Please sign in to comment.