Message ID | 20250924124713.3361707-3-barnabas.pocze@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h index cb642e0a9..0552a9f30 100644 --- a/include/libcamera/base/bound_method.h +++ b/include/libcamera/base/bound_method.h @@ -97,9 +97,9 @@ private: [[maybe_unused]] auto *args = static_cast<PackType *>(pack); if constexpr (!std::is_void_v<R>) - args->ret_ = invoke(std::get<I>(args->args_)...); + args->ret_ = invoke(std::forward<std::remove_cv_t<Args>>(std::get<I>(args->args_))...); else - invoke(std::get<I>(args->args_)...); + invoke(std::forward<std::remove_cv_t<Args>>(std::get<I>(args->args_))...); } public:
At the moment a single argument pack is used just once, hence it is safe to forward the arguments from the pack, allowing moving to take place instead of copying. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- include/libcamera/base/bound_method.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)