From patchwork Wed Sep 24 12:47:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 24448 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C8AB7BDB1C for ; Wed, 24 Sep 2025 12:47:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A41896B605; Wed, 24 Sep 2025 14:47:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YlHyXQ2P"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 115BC6B5F0 for ; Wed, 24 Sep 2025 14:47:17 +0200 (CEST) Received: from pb-laptop.local (185.221.140.70.nat.pool.zt.hu [185.221.140.70]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 05E1C15E9; Wed, 24 Sep 2025 14:45:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1758717953; bh=vh+fIL4wFVuH2fOBu8NgwwtpBDP/2tf5eRRCK6gsAeA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YlHyXQ2PF2pRvJdcabAYrsYV6HOXzqpdfM6/BDWuTN21mUI9jppMDuhmhOP9o0jqu bJw0eKrJwX2qjRL3Dgxnl7lezzQh+kVFP5A6vKE1ET2SBMIH+3c3nlSnHQ/9QG6cyn 0Uq323s0BFBG/LFLEPbT90HF0d3qcPmWrceqN+08= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org, Kieran Bingham Subject: [RFC PATCH v1 2/7] libcamera: base: bound_method: Forward when invoking Date: Wed, 24 Sep 2025 14:47:07 +0200 Message-ID: <20250924124713.3361707-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250924124713.3361707-1-barnabas.pocze@ideasonboard.com> References: <20250924124713.3361707-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- include/libcamera/base/bound_method.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(pack); if constexpr (!std::is_void_v) - args->ret_ = invoke(std::get(args->args_)...); + args->ret_ = invoke(std::forward>(std::get(args->args_))...); else - invoke(std::get(args->args_)...); + invoke(std::forward>(std::get(args->args_))...); } public: