{"id":23872,"url":"https://patchwork.libcamera.org/api/1.1/patches/23872/?format=json","web_url":"https://patchwork.libcamera.org/patch/23872/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250721104622.1550908-5-barnabas.pocze@ideasonboard.com>","date":"2025-07-21T10:46:04","name":"[RFC,v2,04/22] libcamera: base: cxx20: Add `type_identity{, _t}`","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"01fdecc7f03672b7e502b1a6dd8346b2b1b198db","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/1.1/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23872/mbox/","series":[{"id":5305,"url":"https://patchwork.libcamera.org/api/1.1/series/5305/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5305","date":"2025-07-21T10:46:00","name":"libcamera: Add `MetadataList`","version":2,"mbox":"https://patchwork.libcamera.org/series/5305/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23872/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23872/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 47719C3323\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Jul 2025 10:46:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D323E68FF1;\n\tMon, 21 Jul 2025 12:46:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 76EB068FDF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jul 2025 12:46:28 +0200 (CEST)","from pb-laptop.local (185.221.140.39.nat.pool.zt.hu\n\t[185.221.140.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 52FD47939;\n\tMon, 21 Jul 2025 12:45:51 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Yj79Ifrp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753094751;\n\tbh=eNwTfZ3Uy5J86WZjbi4wfpIFD6Fkp868jbsDu91j8wo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Yj79Ifrp/TSWHXa7tlyvs1jZMTpsnxr3O6i3HEwnJRRq/rlukSvdupvANjEXnf2GZ\n\tvyt/KzZwie9e1WMhV8H//E+hSxv/y7PdZ37gSqsP6yADGylds0bYe55EZkFBTcI0eP\n\t+AtK2ccYf1WVx35+6yFkyetHDLG3RRetzvOsaL/s=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"[RFC PATCH v2 04/22] libcamera: base: cxx20: Add `type_identity{,\n\t_t}`","Date":"Mon, 21 Jul 2025 12:46:04 +0200","Message-ID":"<20250721104622.1550908-5-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.50.1","In-Reply-To":"<20250721104622.1550908-1-barnabas.pocze@ideasonboard.com>","References":"<20250721104622.1550908-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":"`type_identity_t` can be used to force non-deduced contexts\nin templates, such as:\n\n  void f(T x, type_identity_t<T> y)\n\nwhen calling `f(1u, 2)`, without `type_identity_t`, the compiler\ncould not unambiguously deduce `T` (unsigned int vs int). However,\nwith `type_identity_t`, the type of the argument passed to `y`\nwill not be used to deduce `T`, only the argument passed to `x`.\n\nSee https://en.cppreference.com/w/cpp/types/type_identity\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/libcamera/base/details/cxx20.h | 3 +++\n 1 file changed, 3 insertions(+)","diff":"diff --git a/include/libcamera/base/details/cxx20.h b/include/libcamera/base/details/cxx20.h\nindex 0d6173d1b..2d26db53e 100644\n--- a/include/libcamera/base/details/cxx20.h\n+++ b/include/libcamera/base/details/cxx20.h\n@@ -9,4 +9,7 @@\n \n namespace libcamera::details::cxx20 {\n \n+template<typename T> struct type_identity { using type = T; };\n+template<typename T> using type_identity_t = typename type_identity<T>::type;\n+\n } /* namespace libcamera::details::cxx20 */\n","prefixes":["RFC","v2","04/22"]}