[{"id":38824,"web_url":"https://patchwork.libcamera.org/comment/38824/","msgid":"<20260508133914.GM2176058@killaraus.ideasonboard.com>","date":"2026-05-08T13:39:14","subject":"Re: [PATCH v1] libcamera: base: signal: Disallow rvalue references","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, May 08, 2026 at 02:18:43PM +0200, Barnabás Pőcze wrote:\n> The main use of rvalue references is \"moving\", usually taking\n> ownership of the resources of an object and setting it to some\n> kind of \"empty\" state. However, it is not clear how that could\n> (or should) work with a signal that has multiple recipients,\n> so disallow the use of rvalue references as signal arguments.\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\nThank you for writing and sending the patch Barnabás.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/base/signal.h | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h\n> index ed1d81ea5c..2bac5a9832 100644\n> --- a/include/libcamera/base/signal.h\n> +++ b/include/libcamera/base/signal.h\n> @@ -37,6 +37,8 @@ private:\n>  template<typename... Args>\n>  class Signal : public SignalBase\n>  {\n> +\tstatic_assert((!std::is_rvalue_reference_v<Args> && ...));\n> +\n>  public:\n>  \t~Signal()\n>  \t{","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E4A1CBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 May 2026 13:39:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 16E4C6301A;\n\tFri,  8 May 2026 15:39:18 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8971962FD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 May 2026 15:39:16 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5043ABCA;\n\tFri,  8 May 2026 15:39:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VLx8G2M0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778247551;\n\tbh=etDyHOynqxcr5ZS36ETTgU9ytP1rrGP0qWKC7NOiSJY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=VLx8G2M0KfkkswvlG55HGNMcjLPT0bN2QRjMFIamMEiL/r2/J85uB9dZl3h1C9MsW\n\t4d8uCLRMsuHeaZUFqwqLKYSWpDkH+D2YkdfbwxlX46KjqOQKBjrndea1yf+7g/NR7J\n\ta7eTjJLrLQmiJ29JzIidutvXAdi3u2/0yC+IGfI0=","Date":"Fri, 8 May 2026 16:39:14 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1] libcamera: base: signal: Disallow rvalue references","Message-ID":"<20260508133914.GM2176058@killaraus.ideasonboard.com>","References":"<20260508121843.196871-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260508121843.196871-1-barnabas.pocze@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38825,"web_url":"https://patchwork.libcamera.org/comment/38825/","msgid":"<177824768262.182289.6470612965070676604@ping.linuxembedded.co.uk>","date":"2026-05-08T13:41:22","subject":"Re: [PATCH v1] libcamera: base: signal: Disallow rvalue references","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2026-05-08 13:18:43)\n> The main use of rvalue references is \"moving\", usually taking\n> ownership of the resources of an object and setting it to some\n> kind of \"empty\" state. However, it is not clear how that could\n> (or should) work with a signal that has multiple recipients,\n> so disallow the use of rvalue references as signal arguments.\n\nmove it around in a token ring ? ;-)\n\nBut yeah - disallowing is better!\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  include/libcamera/base/signal.h | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h\n> index ed1d81ea5c..2bac5a9832 100644\n> --- a/include/libcamera/base/signal.h\n> +++ b/include/libcamera/base/signal.h\n> @@ -37,6 +37,8 @@ private:\n>  template<typename... Args>\n>  class Signal : public SignalBase\n>  {\n> +       static_assert((!std::is_rvalue_reference_v<Args> && ...));\n> +\n>  public:\n>         ~Signal()\n>         {\n> -- \n> 2.54.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A2C4DBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 May 2026 13:41:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E4AD36301E;\n\tFri,  8 May 2026 15:41:26 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 87C6262FD3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 May 2026 15:41:25 +0200 (CEST)","from monstersaurus.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A3E36BCA;\n\tFri,  8 May 2026 15:41:20 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pfZ83zBF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778247680;\n\tbh=TPqQnWHjr4guXEu+g527K9EH7Bw1aWFIi9BXyEmbz9Y=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=pfZ83zBFA2XyLLpNBQz3646D5BdwxhbXV54JuIH+8G0924Z6EfPaj9WXu9ABlbdR7\n\tFGhj5sboINnS74JYJxTcXGhTCBR+9Bk7xN80NT77ZZP+xX7b+3i3S6R7MUlSGzQvu9\n\ttRvu3lLN1gpSkWTppKLWkMogZS2rl/c0dKiF3J70=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260508121843.196871-1-barnabas.pocze@ideasonboard.com>","References":"<20260508121843.196871-1-barnabas.pocze@ideasonboard.com>","Subject":"Re: [PATCH v1] libcamera: base: signal: Disallow rvalue references","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 08 May 2026 14:41:22 +0100","Message-ID":"<177824768262.182289.6470612965070676604@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]