Patch Detail
Show a patch.
GET /api/1.1/patches/24834/?format=api
{ "id": 24834, "url": "https://patchwork.libcamera.org/api/1.1/patches/24834/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24834/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20251027105333.103186-2-barnabas.pocze@ideasonboard.com>", "date": "2025-10-27T10:53:32", "name": "[v1,1/2] libcamera: base: utils: Simplify `enumerate()`", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "4082d8acc0a8037e4949185dde4aac75bb18213c", "submitter": { "id": 216, "url": "https://patchwork.libcamera.org/api/1.1/people/216/?format=api", "name": "Barnabás Pőcze", "email": "barnabas.pocze@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24834/mbox/", "series": [ { "id": 5533, "url": "https://patchwork.libcamera.org/api/1.1/series/5533/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5533", "date": "2025-10-27T10:53:31", "name": "Fix doxygen 1.15.0 issues", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5533/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24834/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24834/checks/", "tags": {}, "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 7C051C32CE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Oct 2025 10:53:40 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2B4786075B;\n\tMon, 27 Oct 2025 11:53:40 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9AFD060707\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Oct 2025 11:53:36 +0100 (CET)", "from pb-laptop.local (185.182.215.162.nat.pool.zt.hu\n\t[185.182.215.162])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C224516AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Oct 2025 11:51:48 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EhBYyKcK\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761562308;\n\tbh=uBKi+OiywSWkN660kQkejMg0ujB6o+5uVleGg4jD5uA=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=EhBYyKcKoAoAojckRqzSO+MRRPVnxbF0OHcP17pApmAgglrSMGK+sRZeH9WE3IkLT\n\tOTKan+RGdmYD5BG1yaajHsSJq5K/BehNQChc035+lKFvmLaUHoOXHywUuBqePBryju\n\t5Nr3XGkdrvHKEiqVUPJ+1VJy8GFF75xQ5JwzGTSc=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH v1 1/2] libcamera: base: utils: Simplify `enumerate()`", "Date": "Mon, 27 Oct 2025 11:53:32 +0100", "Message-ID": "<20251027105333.103186-2-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.51.1", "In-Reply-To": "<20251027105333.103186-1-barnabas.pocze@ideasonboard.com>", "References": "<20251027105333.103186-1-barnabas.pocze@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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>" }, "content": "`std::{begin,end}()` support arrays, thus there is no need for a second\noverload. The only reason it is currently needed is that the trailing\nreturn type of the first overload uses `iterable.begin()`, which leads\nto a substitution failure, so that overload is not considered.\n\nSo remove the array overload, and let CTAD deduce the `Base` template\nparameter of `enumerate_adapter`, which will make things work for\narrays as well.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/base/utils.h | 12 ++----------\n 1 file changed, 2 insertions(+), 10 deletions(-)", "diff": "diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\nindex cb8caaa9ba..d32bd1cd62 100644\n--- a/include/libcamera/base/utils.h\n+++ b/include/libcamera/base/utils.h\n@@ -355,19 +355,11 @@ private:\n } /* namespace details */\n \n template<typename T>\n-auto enumerate(T &iterable) -> details::enumerate_adapter<decltype(iterable.begin())>\n+auto enumerate(T &iterable)\n {\n-\treturn { std::begin(iterable), std::end(iterable) };\n+\treturn details::enumerate_adapter{ std::begin(iterable), std::end(iterable) };\n }\n \n-#ifndef __DOXYGEN__\n-template<typename T, size_t N>\n-auto enumerate(T (&iterable)[N]) -> details::enumerate_adapter<T *>\n-{\n-\treturn { std::begin(iterable), std::end(iterable) };\n-}\n-#endif\n-\n class Duration : public std::chrono::duration<double, std::nano>\n {\n \tusing BaseDuration = std::chrono::duration<double, std::nano>;\n", "prefixes": [ "v1", "1/2" ] }