Skip to content

Commit

Permalink
Correctly move callable f in ConsumeRvalues call operator
Browse files Browse the repository at this point in the history
  • Loading branch information
aurianer committed Aug 24, 2023
1 parent 9dba07b commit 130b7d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/dlaf/common/consume_rvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ struct ConsumeRvalues {
std::decay_t<F> f;

template <typename... Ts>
auto operator()(Ts&&... ts) -> decltype(std::move(f)(consume_rvalue(std::forward<Ts>(ts))...)) {
auto operator()(Ts&&... ts) && -> decltype(std::move(f)(consume_rvalue(std::forward<Ts>(ts))...)) {
return std::move(f)(consume_rvalue(std::forward<Ts>(ts))...);
}

template <typename... Ts>
auto operator()(Ts&&... ts) & -> decltype(f(consume_rvalue(std::forward<Ts>(ts))...)) {
return f(consume_rvalue(std::forward<Ts>(ts))...);
}
};

template <typename F>
Expand Down

0 comments on commit 130b7d3

Please sign in to comment.