Skip to content

Commit

Permalink
util/variant: seastar::visit forward value arg
Browse files Browse the repository at this point in the history
Internally we only use it for lvalue references, so passing the argument
to std::visit as is looks relevant. However, since seastar::visit
accepts universal reference it should handle it appropriately for not to
surprise callers by copying its argument implicitly.
  • Loading branch information
bashtanov authored and avikivity committed Feb 5, 2025
1 parent 73dd1d4 commit 8ebfc99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/seastar/util/variant_utils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ inline auto visit(Variant&& variant, Args&&... args)
static_assert(sizeof...(Args) > 0, "At least one lambda must be provided for visitation");
return std::visit(
make_visitor(std::forward<Args>(args)...),
variant);
std::forward<Variant>(variant));
}

namespace internal {
Expand Down

0 comments on commit 8ebfc99

Please sign in to comment.