Skip to content

Commit

Permalink
fix missing forward for function object parameter (#2092)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisenwave authored Jan 18, 2024
1 parent 48d57dc commit 85e2fa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CppCoreGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -3142,9 +3142,9 @@ In that case, and only that case, make the parameter `TP&&` where `TP` is a temp
Usually you forward the entire parameter (or parameter pack, using `...`) exactly once on every static control flow path:

template<class F, class... Args>
inline auto invoke(F f, Args&&... args)
inline decltype(auto) invoke(F&& f, Args&&... args)
{
return f(forward<Args>(args)...);
return forward<F>(f)(forward<Args>(args)...);
}

##### Example
Expand Down

0 comments on commit 85e2fa3

Please sign in to comment.