Patch Detail
Show a patch.
GET /api/patches/2834/?format=api
{ "id": 2834, "url": "https://patchwork.libcamera.org/api/patches/2834/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2834/", "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": "<20200216001304.5167-1-laurent.pinchart@ideasonboard.com>", "date": "2020-02-16T00:13:04", "name": "[libcamera-devel] libcamera: Use C++14 std::*_t type traits", "commit_ref": "b5eff18f1aef980fa7eb55184996710a6fc9523e", "pull_url": null, "state": "accepted", "archived": false, "hash": "9213c17a180affde263e09c46bd3bcc7cb168e06", "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/2834/mbox/", "series": [ { "id": 675, "url": "https://patchwork.libcamera.org/api/series/675/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=675", "date": "2020-02-16T00:13:04", "name": "[libcamera-devel] libcamera: Use C++14 std::*_t type traits", "version": 1, "mbox": "https://patchwork.libcamera.org/series/675/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2834/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2834/checks/", "tags": {}, "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 A81F761020\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 16 Feb 2020 01:13:28 +0100 (CET)", "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0B32B2D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 16 Feb 2020 01:13:27 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1581812008;\n\tbh=FETkKt154A4fE5e9r0uP5Jg5qXfBuT08clnz0Seb/b4=;\n\th=From:To:Subject:Date:From;\n\tb=ineqiG0g1omOaAup9m0c9tbZ6akaY7snpxwXsK0De/IGo6lcMEWtSX5nntp3NUU6u\n\tdNwhCFc3Pvwnh16g5HzHf4j2oI8H4hp/uYROZbzyB7nHuRG4ctJXI6n/qg9yw8Jefk\n\try2DnckTeHkao7fR4PAaAvnpW/pISLXqiYq8Uojo=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 16 Feb 2020 02:13:04 +0200", "Message-Id": "<20200216001304.5167-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.24.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: Use C++14 std::*_t type traits", "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>", "X-List-Received-Date": "Sun, 16 Feb 2020 00:13:28 -0000" }, "content": "C++14 introduced useful type traits helpers named std::*_t as aliases to\nstd::*<...>::type. Use them to simplify the code.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/bound_method.h | 6 +++---\n include/libcamera/object.h | 2 +-\n include/libcamera/signal.h | 4 ++--\n src/libcamera/ipa_module.cpp | 10 +++++-----\n 4 files changed, 11 insertions(+), 11 deletions(-)", "diff": "diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h\nindex 7ffd2e426e18..983bb5cbbad0 100644\n--- a/include/libcamera/bound_method.h\n+++ b/include/libcamera/bound_method.h\n@@ -38,7 +38,7 @@ public:\n \t{\n \t}\n \n-\tstd::tuple<typename std::remove_reference<Args>::type...> args_;\n+\tstd::tuple<typename std::remove_reference_t<Args>...> args_;\n \tR ret_;\n };\n \n@@ -51,7 +51,7 @@ public:\n \t{\n \t}\n \n-\tstd::tuple<typename std::remove_reference<Args>::type...> args_;\n+\tstd::tuple<typename std::remove_reference_t<Args>...> args_;\n };\n \n class BoundMethodBase\n@@ -63,7 +63,7 @@ public:\n \t}\n \tvirtual ~BoundMethodBase() {}\n \n-\ttemplate<typename T, typename std::enable_if<!std::is_same<Object, T>::value>::type * = nullptr>\n+\ttemplate<typename T, typename std::enable_if_t<!std::is_same<Object, T>::value> * = nullptr>\n \tbool match(T *obj) { return obj == obj_; }\n \tbool match(Object *object) { return object == object_; }\n \ndiff --git a/include/libcamera/object.h b/include/libcamera/object.h\nindex 4d16f3f2b610..9a3dd0702d39 100644\n--- a/include/libcamera/object.h\n+++ b/include/libcamera/object.h\n@@ -30,7 +30,7 @@ public:\n \tvoid postMessage(std::unique_ptr<Message> msg);\n \n \ttemplate<typename T, typename R, typename... FuncArgs, typename... Args,\n-\t\t typename std::enable_if<std::is_base_of<Object, T>::value>::type * = nullptr>\n+\t\t typename std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>\n \tR invokeMethod(R (T::*func)(FuncArgs...), ConnectionType type,\n \t\t Args... args)\n \t{\ndiff --git a/include/libcamera/signal.h b/include/libcamera/signal.h\nindex c13bb30f0636..ed30eb559127 100644\n--- a/include/libcamera/signal.h\n+++ b/include/libcamera/signal.h\n@@ -45,7 +45,7 @@ public:\n \t}\n \n #ifndef __DOXYGEN__\n-\ttemplate<typename T, typename R, typename std::enable_if<std::is_base_of<Object, T>::value>::type * = nullptr>\n+\ttemplate<typename T, typename R, typename std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>\n \tvoid connect(T *obj, R (T::*func)(Args...),\n \t\t ConnectionType type = ConnectionTypeAuto)\n \t{\n@@ -53,7 +53,7 @@ public:\n \t\tSignalBase::connect(new BoundMethodMember<T, void, Args...>(obj, object, func, type));\n \t}\n \n-\ttemplate<typename T, typename R, typename std::enable_if<!std::is_base_of<Object, T>::value>::type * = nullptr>\n+\ttemplate<typename T, typename R, typename std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr>\n #else\n \ttemplate<typename T, typename R>\n #endif\ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex de65525b8319..a01d0757ff8f 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -42,20 +42,20 @@ LOG_DEFINE_CATEGORY(IPAModule)\n namespace {\n \n template<typename T>\n-typename std::remove_extent<T>::type *elfPointer(void *map, off_t offset,\n-\t\t\t\t\t\t size_t fileSize, size_t objSize)\n+typename std::remove_extent_t<T> *elfPointer(void *map, off_t offset,\n+\t\t\t\t\t size_t fileSize, size_t objSize)\n {\n \tsize_t size = offset + objSize;\n \tif (size > fileSize || size < objSize)\n \t\treturn nullptr;\n \n-\treturn reinterpret_cast<typename std::remove_extent<T>::type *>\n+\treturn reinterpret_cast<typename std::remove_extent_t<T> *>\n \t\t(static_cast<char *>(map) + offset);\n }\n \n template<typename T>\n-typename std::remove_extent<T>::type *elfPointer(void *map, off_t offset,\n-\t\t\t\t\t\t size_t fileSize)\n+typename std::remove_extent_t<T> *elfPointer(void *map, off_t offset,\n+\t\t\t\t\t size_t fileSize)\n {\n \treturn elfPointer<T>(map, offset, fileSize, sizeof(T));\n }\n", "prefixes": [ "libcamera-devel" ] }