[{"id":29882,"web_url":"https://patchwork.libcamera.org/comment/29882/","msgid":"<Zmqeb7QNc8OWRBaT@pyrite.rasen.tech>","date":"2024-06-13T07:23:27","subject":"Re: [PATCH 01/11] libcamera: yaml_parser: Drop std::enable_if_t\n\tguards for get() function","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Thu, Jun 13, 2024 at 04:39:34AM +0300, Laurent Pinchart wrote:\n> The YamlObject::get() function template is implemented for a set of\n> basic types through template specializations. The function declaration\n> uses std::enable_if_t<> guards to signal incorrect usage at compilation\n> time. This however prevents the API to be extended with additional\n> specializations in other compilation units.\n> \n> To prepare for new specializations of the function for the ipa::Vector\n> and ipa::Pwl classes types, implemented in their respective compilation\n> units, drop the std::enable_it_t<> guards. Incorrect usage will still be\n> reported as link errors.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  include/libcamera/internal/yaml_parser.h | 15 ---------------\n>  1 file changed, 15 deletions(-)\n> \n> diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h\n> index 3ac27e06f69d..81cc0e25ae0f 100644\n> --- a/include/libcamera/internal/yaml_parser.h\n> +++ b/include/libcamera/internal/yaml_parser.h\n> @@ -161,22 +161,7 @@ public:\n>  \n>  \tstd::size_t size() const;\n>  \n> -#ifndef __DOXYGEN__\n> -\ttemplate<typename T,\n> -\t\t std::enable_if_t<\n> -\t\t\t std::is_same_v<bool, T> ||\n> -\t\t\t std::is_same_v<double, T> ||\n> -\t\t\t std::is_same_v<int8_t, T> ||\n> -\t\t\t std::is_same_v<uint8_t, T> ||\n> -\t\t\t std::is_same_v<int16_t, T> ||\n> -\t\t\t std::is_same_v<uint16_t, T> ||\n> -\t\t\t std::is_same_v<int32_t, T> ||\n> -\t\t\t std::is_same_v<uint32_t, T> ||\n> -\t\t\t std::is_same_v<std::string, T> ||\n> -\t\t\t std::is_same_v<Size, T>> * = nullptr>\n> -#else\n>  \ttemplate<typename T>\n> -#endif\n>  \tstd::optional<T> get() const;\n>  \n>  \ttemplate<typename T, typename U>","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 D7061BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Jun 2024 07:23:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B57856548D;\n\tThu, 13 Jun 2024 09:23:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C160765458\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Jun 2024 09:23:36 +0200 (CEST)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8637E4CF;\n\tThu, 13 Jun 2024 09:23:21 +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=\"c/dF4Xwn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718263402;\n\tbh=OM8E3AfTaIPpKwYqFxJXAxzMDdHxursnUPmbKZy2m28=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=c/dF4Xwn/SeVNDjiSHvSsd+q9Imv11U0XYfAmpdComf+FYPCzluQ0dMXZsT7ZhKCa\n\t79wiIK2izMHOJoWEXtBiKvDtZKmDhUpDH0lO2C0J+ovQJraOSTr12/oI9T6TN10/en\n\tjI0nRB2u05Raxv5s/YoErTV+9SweUzVrWpLeLvbY=","Date":"Thu, 13 Jun 2024 16:23:27 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","Subject":"Re: [PATCH 01/11] libcamera: yaml_parser: Drop std::enable_if_t\n\tguards for get() function","Message-ID":"<Zmqeb7QNc8OWRBaT@pyrite.rasen.tech>","References":"<20240613013944.23344-1-laurent.pinchart@ideasonboard.com>\n\t<20240613013944.23344-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240613013944.23344-2-laurent.pinchart@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":29910,"web_url":"https://patchwork.libcamera.org/comment/29910/","msgid":"<171827683739.2248009.2843228208014725532@ping.linuxembedded.co.uk>","date":"2024-06-13T11:07:17","subject":"Re: [PATCH 01/11] libcamera: yaml_parser: Drop std::enable_if_t\n\tguards for get() function","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-06-13 02:39:34)\n> The YamlObject::get() function template is implemented for a set of\n> basic types through template specializations. The function declaration\n> uses std::enable_if_t<> guards to signal incorrect usage at compilation\n> time. This however prevents the API to be extended with additional\n> specializations in other compilation units.\n> \n> To prepare for new specializations of the function for the ipa::Vector\n> and ipa::Pwl classes types, implemented in their respective compilation\n> units, drop the std::enable_it_t<> guards. Incorrect usage will still be\n> reported as link errors.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  include/libcamera/internal/yaml_parser.h | 15 ---------------\n>  1 file changed, 15 deletions(-)\n> \n> diff --git a/include/libcamera/internal/yaml_parser.h b/include/libcamera/internal/yaml_parser.h\n> index 3ac27e06f69d..81cc0e25ae0f 100644\n> --- a/include/libcamera/internal/yaml_parser.h\n> +++ b/include/libcamera/internal/yaml_parser.h\n> @@ -161,22 +161,7 @@ public:\n>  \n>         std::size_t size() const;\n>  \n> -#ifndef __DOXYGEN__\n> -       template<typename T,\n> -                std::enable_if_t<\n> -                        std::is_same_v<bool, T> ||\n> -                        std::is_same_v<double, T> ||\n> -                        std::is_same_v<int8_t, T> ||\n> -                        std::is_same_v<uint8_t, T> ||\n> -                        std::is_same_v<int16_t, T> ||\n> -                        std::is_same_v<uint16_t, T> ||\n> -                        std::is_same_v<int32_t, T> ||\n> -                        std::is_same_v<uint32_t, T> ||\n> -                        std::is_same_v<std::string, T> ||\n> -                        std::is_same_v<Size, T>> * = nullptr>\n> -#else\n>         template<typename T>\n> -#endif\n>         std::optional<T> get() const;\n>  \n>         template<typename T, typename U>\n> -- \n> Regards,\n> \n> Laurent Pinchart\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 31178BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Jun 2024 11:07:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E56FA6548E;\n\tThu, 13 Jun 2024 13:07:20 +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 8623D6548D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Jun 2024 13:07:19 +0200 (CEST)","from pendragon.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 8E30C4CF;\n\tThu, 13 Jun 2024 13:07:05 +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=\"OSji6Jov\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718276825;\n\tbh=e2kwJanYFnjKgxYny8U+smYGMUCa78WQ7cXcQ7GXbfs=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=OSji6JovG5PqfOMdEs9Ning8YN9hSykHgmGRL3uJeHCwRUbU+6GI063YyEGjiYZ5p\n\t1hUvt9uu3xVBKcC68MN+/9z7H4CJvkVcgVcqKTZJ9XFDrUquykzJNHl/8gY6G31q91\n\tePjO9uLwM8R7V1c6HibTE7mVTh3gex8FO1RXtOYc=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240613013944.23344-2-laurent.pinchart@ideasonboard.com>","References":"<20240613013944.23344-1-laurent.pinchart@ideasonboard.com>\n\t<20240613013944.23344-2-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 01/11] libcamera: yaml_parser: Drop std::enable_if_t\n\tguards for get() function","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 13 Jun 2024 12:07:17 +0100","Message-ID":"<171827683739.2248009.2843228208014725532@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]