Show a patch.

GET /api/patches/26704/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 26704,
    "url": "https://patchwork.libcamera.org/api/patches/26704/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26704/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20260508221033.2417134-1-laurent.pinchart@ideasonboard.com>",
    "date": "2026-05-08T22:10:33",
    "name": "libcamera: bound_method: Use std::apply",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "575f62cc6e098ea90966f4379a4303bdf194562e",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26704/mbox/",
    "series": [
        {
            "id": 5928,
            "url": "https://patchwork.libcamera.org/api/series/5928/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5928",
            "date": "2026-05-08T22:10:33",
            "name": "libcamera: bound_method: Use std::apply",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5928/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26704/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26704/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 50625BDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 May 2026 22:10:37 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6938C63025;\n\tSat,  9 May 2026 00:10:36 +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 EC1C862010\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  9 May 2026 00:10:34 +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 AC9E84DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  9 May 2026 00:10:29 +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=\"hdC3yIQ0\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778278229;\n\tbh=OAC4Dqs8KFNvSfXXWseX+R0xMY3RHvZrV+NSCRriBec=;\n\th=From:To:Subject:Date:From;\n\tb=hdC3yIQ0cGfyDJjcBeZJQhsKcczTCLaWTUk0IX+EYnmP585rSieGVX+p75eUsC0bC\n\tSfurwn92IsSAWgVxsPKNyt9mrQF7DVX+Zq7U+viCqwC+caZpGEIw4oN6/ust9hHjks\n\t/Yq/meqYiGukep3glnwDaFOmBlVVavkOdwsjwNAk=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH] libcamera: bound_method: Use std::apply",
        "Date": "Sat,  9 May 2026 01:10:33 +0300",
        "Message-ID": "<20260508221033.2417134-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "MIME-Version": "1.0",
        "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": "Now that libcamera uses C++20, we can use std::apply to replace the\ncustom implementation.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/base/bound_method.h | 13 ++++++-------\n 1 file changed, 6 insertions(+), 7 deletions(-)\n\n\nbase-commit: 2ca75f012fa12621ed70e333e635d173e92593e5",
    "diff": "diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h\nindex 91fe8b8cb969..ad5374f70b18 100644\n--- a/include/libcamera/base/bound_method.h\n+++ b/include/libcamera/base/bound_method.h\n@@ -91,15 +91,14 @@ public:\n \tusing PackType = BoundMethodPack<R, Args...>;\n \n private:\n-\ttemplate<std::size_t... I>\n-\tvoid invokePack(BoundMethodPackBase *pack, std::index_sequence<I...>)\n+\tvoid invokePack(PackType *args)\n \t{\n-\t\t[[maybe_unused]] auto *args = static_cast<PackType *>(pack);\n-\n \t\tif constexpr (!std::is_void_v<R>)\n-\t\t\targs->ret_ = invoke(std::get<I>(args->args_)...);\n+\t\t\targs->ret_ = std::apply(&BoundMethodArgs::invoke,\n+\t\t\t\t\t\tstd::tuple_cat(std::forward_as_tuple(this), args->args_));\n \t\telse\n-\t\t\tinvoke(std::get<I>(args->args_)...);\n+\t\t\tstd::apply(&BoundMethodArgs::invoke,\n+\t\t\t\t   std::tuple_cat(std::forward_as_tuple(this), args->args_));\n \t}\n \n public:\n@@ -108,7 +107,7 @@ public:\n \n \tvoid invokePack(BoundMethodPackBase *pack) override\n \t{\n-\t\tinvokePack(pack, std::make_index_sequence<sizeof...(Args)>{});\n+\t\tinvokePack(static_cast<PackType *>(pack));\n \t}\n \n \tvirtual R activate(Args... args, bool deleteMethod = false) = 0;\n",
    "prefixes": []
}