From patchwork Fri May 8 12:18:43 2026 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: 26689 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 2AED5BE173 for ; Fri, 8 May 2026 12:18:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7C2D162FE1; Fri, 8 May 2026 14:18:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="I7H9OnRk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 992C862FD3 for ; Fri, 8 May 2026 14:18:46 +0200 (CEST) Received: from pb-laptop.local (185.221.140.217.nat.pool.zt.hu [185.221.140.217]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D530B9A4 for ; Fri, 8 May 2026 14:18:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1778242721; bh=JkmDQZIBnbSFfLdGlMzAmKuOO8CZRF6hcqsXzglHHzU=; h=From:To:Subject:Date:From; b=I7H9OnRk4l3H4eO4ysyuBu1zbTgdx8bzwNUsN9+6JlJkitH41acPYhO3HW8aujJkN CLmteFAEls2vEHYKmHI4yQGIrBOB7QTADiOEwvOyWvve0W//gE8FMJ+lKUDOGOdMys /x7F8EmYvKissix/LmsAQUa8qKcsJI7hUFAd4PWU= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: base: signal: Disallow rvalue references Date: Fri, 8 May 2026 14:18:43 +0200 Message-ID: <20260508121843.196871-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.54.0 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" The main use of rvalue references is "moving", usually taking ownership of the resources of an object and setting it to some kind of "empty" state. However, it is not clear how that could (or should) work with a signal that has multiple recipients, so disallow the use of rvalue references as signal arguments. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/base/signal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h index ed1d81ea5c..2bac5a9832 100644 --- a/include/libcamera/base/signal.h +++ b/include/libcamera/base/signal.h @@ -37,6 +37,8 @@ private: template class Signal : public SignalBase { + static_assert((!std::is_rvalue_reference_v && ...)); + public: ~Signal() {