[{"id":638,"web_url":"https://patchwork.libcamera.org/comment/638/","msgid":"<20190127144446.2fvhp3jeohsycqei@uno.localdomain>","date":"2019-01-27T14:44:46","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_device: Fix operator=\n\tdefinition","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"On Sun, Jan 27, 2019 at 03:41:52PM +0100, Jacopo Mondi wrote:\n> While the C++ allows the redefinition of operator= to return an\n\nC++ \"standard\"\n\nWill eventually fix when pushing.\n\n> arbitrary type, it is customary to return a reference to the assigned\n> value type.\n>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/include/v4l2_device.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index 413bb7f..c67ebbf 100644\n> --- a/src/libcamera/include/v4l2_device.h\n> +++ b/src/libcamera/include/v4l2_device.h\n> @@ -62,7 +62,7 @@ public:\n>  \tV4L2Device(const V4L2Device &) = delete;\n>  \t~V4L2Device();\n>\n> -\tvoid operator=(const V4L2Device &) = delete;\n> +\tV4L2Device &operator=(const V4L2Device &) = delete;\n>\n>  \tint open();\n>  \tbool isOpen() const;\n> --\n> 2.20.1\n>","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6A53A60C78\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 27 Jan 2019 15:44:32 +0100 (CET)","from uno.localdomain\n\t(host20-49-dynamic.18-79-r.retail.telecomitalia.it [79.18.49.20])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id 22831200006\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 27 Jan 2019 14:44:31 +0000 (UTC)"],"Date":"Sun, 27 Jan 2019 15:44:46 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190127144446.2fvhp3jeohsycqei@uno.localdomain>","References":"<20190127144152.9154-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"567ukabcxg5x4obk\"","Content-Disposition":"inline","In-Reply-To":"<20190127144152.9154-1-jacopo@jmondi.org>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_device: Fix operator=\n\tdefinition","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Sun, 27 Jan 2019 14:44:32 -0000"}},{"id":640,"web_url":"https://patchwork.libcamera.org/comment/640/","msgid":"<20190127160925.GB5934@pendragon.ideasonboard.com>","date":"2019-01-27T16:09:25","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_device: Fix operator=\n\tdefinition","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Sun, Jan 27, 2019 at 03:41:52PM +0100, Jacopo Mondi wrote:\n> While the C++ allows the redefinition of operator= to return an\n> arbitrary type, it is customary to return a reference to the assigned\n> value type.\n\nIt's a bit more than customary, as you wouldn't be able to write\n\n\ta = b = c;\n\notherwise. In any case the operator= can't be used if you declarate a\ndeleted operator, regardless of the return type, so this is fine.\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/include/v4l2_device.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index 413bb7f..c67ebbf 100644\n> --- a/src/libcamera/include/v4l2_device.h\n> +++ b/src/libcamera/include/v4l2_device.h\n> @@ -62,7 +62,7 @@ public:\n>  \tV4L2Device(const V4L2Device &) = delete;\n>  \t~V4L2Device();\n> \n> -\tvoid operator=(const V4L2Device &) = delete;\n> +\tV4L2Device &operator=(const V4L2Device &) = delete;\n> \n>  \tint open();\n>  \tbool isOpen() const;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 5D8E260DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 27 Jan 2019 17:09:30 +0100 (CET)","from pendragon.ideasonboard.com (85-76-23-203-nat.elisa-mobile.fi\n\t[85.76.23.203])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9DB86564;\n\tSun, 27 Jan 2019 17:09:28 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548605369;\n\tbh=73bgAhWiFGokyJyRnX9YzSDU1ERxfReY6A+p7ikhHGQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=tid1ntI/Vikger3htgmrSOuZ74gSqo0aNnZNPU/2ASe2HVSb6FdsO/g0mN3YjiObv\n\tsp/oz58+KW+kNmlfBZWyHQJ+hEK50gO3kXDkbQt0amg0zEyjrU5fasZZixqdGR2XMt\n\t1shFg+1shEZdug1ubIZnL//lWIY1fjoe3rMT0CK4=","Date":"Sun, 27 Jan 2019 18:09:25 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190127160925.GB5934@pendragon.ideasonboard.com>","References":"<20190127144152.9154-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190127144152.9154-1-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_device: Fix operator=\n\tdefinition","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Sun, 27 Jan 2019 16:09:30 -0000"}}]