{"id":22871,"url":"https://patchwork.libcamera.org/api/patches/22871/?format=json","web_url":"https://patchwork.libcamera.org/patch/22871/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20250225173531.2595922-2-pobrn@protonmail.com>","date":"2025-02-25T17:35:40","name":"[v4,1/8] libcamera: base: log: Remove move constructor","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"7373baf459d9cabf6abb46443cc701f188eb1e53","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/?format=json","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22871/mbox/","series":[{"id":5022,"url":"https://patchwork.libcamera.org/api/series/5022/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5022","date":"2025-02-25T17:35:34","name":"libcamera: base: log: Misc. changes","version":4,"mbox":"https://patchwork.libcamera.org/series/5022/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22871/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22871/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 D8EC2BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Feb 2025 17:35:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9540B6872B;\n\tTue, 25 Feb 2025 18:35:48 +0100 (CET)","from mail-40133.protonmail.ch (mail-40133.protonmail.ch\n\t[185.70.40.133])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 79843686D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Feb 2025 18:35:47 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"P7TN++2B\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1740504947; x=1740764147;\n\tbh=NohWC25paeDD05GFZEjseHzjU2U90DXzZAy5I7nfmzw=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=P7TN++2B6+qbaPf5Ka3aMlyXJO5SV95UDqndMwANy5IxVoRb4m6BvjhzSYwkfhQWr\n\t95wD8fSEMlKfvt5B1UBusZcCoe7N2+GCLo8dUHjVjqtwB1/qFWpffE16ouIpzCHKR1\n\tkpMf5Adx/DLqYuV9g5ikpqAjlCVC8lkrxCCbAzXPblVrN7pX5fyheyBlHNO7+1Odj+\n\t8Nd3bLMHmkzfLhO2/5N42jFHYMy0pyHOr9JBMy8d68q0vJGqxpb3xnEeVbVOghvKYf\n\thRWTD9uEoRlPECzkhov0aAJS1EjTZ2CVQNDPWxdeXK9b0ktAjcJaQOo7+IFunirgKo\n\tYcN/Ymel1QR6Q==","Date":"Tue, 25 Feb 2025 17:35:40 +0000","To":"libcamera-devel@lists.libcamera.org","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v4 1/8] libcamera: base: log: Remove move constructor","Message-ID":"<20250225173531.2595922-2-pobrn@protonmail.com>","In-Reply-To":"<20250225173531.2595922-1-pobrn@protonmail.com>","References":"<20250225173531.2595922-1-pobrn@protonmail.com>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"9e5ae96a632bb3f5f7cc83d1af8d1f7ecfb54602","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":"C++17 guarantees move and copy elision in certain cases,\nsuch as when returning a prvalue of the same type as the\nreturn type of the function.\n\nThis is what the `_log()` functions do, thus there is no need\nfor the move constructor, so remove it. Furthermore, do not\njust remove the implementation, but instead delete it as well.\n\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/base/log.h |  4 +---\n src/libcamera/base/log.cpp   | 19 -------------------\n 2 files changed, 1 insertion(+), 22 deletions(-)","diff":"diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h\nindex 620930125..b3050eedb 100644\n--- a/include/libcamera/base/log.h\n+++ b/include/libcamera/base/log.h\n@@ -61,8 +61,6 @@ public:\n \tLogMessage(const char *fileName, unsigned int line,\n \t\t   const LogCategory &category, LogSeverity severity,\n \t\t   const std::string &prefix = std::string());\n-\n-\tLogMessage(LogMessage &&);\n \t~LogMessage();\n \n \tstd::ostream &stream() { return msgStream_; }\n@@ -75,7 +73,7 @@ public:\n \tconst std::string msg() const { return msgStream_.str(); }\n \n private:\n-\tLIBCAMERA_DISABLE_COPY(LogMessage)\n+\tLIBCAMERA_DISABLE_COPY_AND_MOVE(LogMessage)\n \n \tvoid init(const char *fileName, unsigned int line);\n \ndiff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\nindex 72e0db859..009f6c737 100644\n--- a/src/libcamera/base/log.cpp\n+++ b/src/libcamera/base/log.cpp\n@@ -866,25 +866,6 @@ LogMessage::LogMessage(const char *fileName, unsigned int line,\n \tinit(fileName, line);\n }\n \n-/**\n- * \\brief Move-construct a log message\n- * \\param[in] other The other message\n- *\n- * The move constructor is meant to support the _log() functions. Thanks to copy\n- * elision it will likely never be called, but C++11 only permits copy elision,\n- * it doesn't enforce it unlike C++17. To avoid potential link errors depending\n- * on the compiler type and version, and optimization level, the move\n- * constructor is defined even if it will likely never be called, and ensures\n- * that the destructor of the \\a other message will not output anything to the\n- * log by setting the severity to LogInvalid.\n- */\n-LogMessage::LogMessage(LogMessage &&other)\n-\t: msgStream_(std::move(other.msgStream_)), category_(other.category_),\n-\t  severity_(other.severity_)\n-{\n-\tother.severity_ = LogInvalid;\n-}\n-\n void LogMessage::init(const char *fileName, unsigned int line)\n {\n \t/* Log the timestamp, severity and file information. */\n","prefixes":["v4","1/8"]}