From 85e2fa321f45c02bfa88581cef5e5f3aa3496b68 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Thu, 18 Jan 2024 19:30:32 +0100 Subject: [PATCH] fix missing forward for function object parameter (#2092) --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 1c8ebde17..9ab5e60b1 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -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 - inline auto invoke(F f, Args&&... args) + inline decltype(auto) invoke(F&& f, Args&&... args) { - return f(forward(args)...); + return forward(f)(forward(args)...); } ##### Example