{"id":25815,"url":"https://patchwork.libcamera.org/api/patches/25815/?format=json","web_url":"https://patchwork.libcamera.org/patch/25815/","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":"<20260115111630.1892890-3-barnabas.pocze@ideasonboard.com>","date":"2026-01-15T11:16:30","name":"[v1,3/3] libcamera: base: utils: Fix names of `operator<<` for `Duration`","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f46efc08e300fd82bc5d5b27d2cdca294a1a2129","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25815/mbox/","series":[{"id":5709,"url":"https://patchwork.libcamera.org/api/series/5709/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5709","date":"2026-01-15T11:16:28","name":"[v1,1/3] libcamera: base: utils: Simplify `operator<<` for `Duration`","version":1,"mbox":"https://patchwork.libcamera.org/series/5709/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25815/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25815/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 7BD80C3274\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Jan 2026 11:16:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F2A9461FBC;\n\tThu, 15 Jan 2026 12:16:36 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5202E61FBB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Jan 2026 12:16:33 +0100 (CET)","from pb-laptop.local (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DCBF14D3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Jan 2026 12:16:05 +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=\"d5qth5Tu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768475765;\n\tbh=ANyZ0k0cKLK4B/teK0xo6/5jNKA5jRhJmA+LsaNSOgw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=d5qth5TuYsY3mAfNOzwxmCFbfrlK2bjy84TBcROh8CwnJ85KtQMIxZrZT/97bmBJ9\n\tK05OM5lBQ9KwUq7teGBHbXMJG4xgm3WyyLZbcnt1j7c9CC9GA8zNlnALiHkHnqUEzt\n\t1PByy8HwqwEFh0QgF/RkM2DlOSTVzxL0fsgcM5gM=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v1 3/3] libcamera: base: utils: Fix names of `operator<<` for\n\t`Duration`","Date":"Thu, 15 Jan 2026 12:16:30 +0100","Message-ID":"<20260115111630.1892890-3-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260115111630.1892890-1-barnabas.pocze@ideasonboard.com>","References":"<20260115111630.1892890-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":"In order for ADL to find the function, it must be in the namespace of any of\nits arguments. Previously, however, that was not the case, and it has only\nreally worked by accident and could be easily made to fail by introducing\nother `operator<<` overloads.\n\nFor example, a user of this function in `libcamera::ipa` would no longer\ncompile after introducing an `operator<<` into the `libcamera::ipa`\nnamespace as that would essentially hide this overload, and without ADL\nit would not be found.\n\nSo move the function into the `utils` namespace.\n\nFixes: 5055ca747c4c (\"libcamera: utils: Add helper class for std::chrono::duration\")\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/base/utils.h | 6 +++---\n src/libcamera/base/utils.cpp   | 6 +++---\n 2 files changed, 6 insertions(+), 6 deletions(-)","diff":"diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\nindex 6ce1ace43..fc4f5079c 100644\n--- a/include/libcamera/base/utils.h\n+++ b/include/libcamera/base/utils.h\n@@ -423,10 +423,10 @@ scope_exit(EF) -> scope_exit<EF>;\n \n #endif /* __DOXYGEN__ */\n \n-} /* namespace utils */\n-\n #ifndef __DOXYGEN__\n-std::ostream &operator<<(std::ostream &os, const utils::Duration &d);\n+std::ostream &operator<<(std::ostream &os, const Duration &d);\n #endif\n \n+} /* namespace utils */\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/base/utils.cpp b/src/libcamera/base/utils.cpp\nindex 2c3f2b7e6..42a516097 100644\n--- a/src/libcamera/base/utils.cpp\n+++ b/src/libcamera/base/utils.cpp\n@@ -655,10 +655,8 @@ void ScopeExitActions::release()\n \tactions_.clear();\n }\n \n-} /* namespace utils */\n-\n #ifndef __DOXYGEN__\n-std::ostream &operator<<(std::ostream &os, const utils::Duration &d)\n+std::ostream &operator<<(std::ostream &os, const Duration &d)\n {\n \tstd::ostringstream s;\n \n@@ -671,4 +669,6 @@ std::ostream &operator<<(std::ostream &os, const utils::Duration &d)\n }\n #endif\n \n+} /* namespace utils */\n+\n } /* namespace libcamera */\n","prefixes":["v1","3/3"]}