From patchwork Tue Jan 20 14:44:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 25889 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 32215C3220 for ; Tue, 20 Jan 2026 14:44:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E694061FCB; Tue, 20 Jan 2026 15:44:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="drOJ5z4Y"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C61D61FBF for ; Tue, 20 Jan 2026 15:44:34 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 705EF2169 for ; Tue, 20 Jan 2026 15:44:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768920243; bh=P35ZL031wovg8BTxZu1wUC2cMnZSxL0Sy3ZpvLm6Ltg=; h=From:To:Subject:Date:From; b=drOJ5z4YRUC9BZEae0qzJEq0PpOHTKLRFLgQ2/4BKbnkO56gpiPSZSAYiBzvSUJC4 /s+xDrCHMtpQ0401wPdU0xsaxg6ry9asdPgc4cMXpIVZ/GwCQJ4NyHQ0XdoImWE2iO Ds++4TeEzjx3iMinEJnq7lO4atg34c0HF8uIhUkY= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: base: utils: join(): Don't use `const_iterator` directly Date: Tue, 20 Jan 2026 15:44:31 +0100 Message-ID: <20260120144431.264758-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" For example, `std::span` does not have a `const_iterator` typedef before C++23, so compilation fails. Simply use `auto`, the `const` qualifier on the `items` variable should already ensure that, if one exists, a "const" iterator will be used. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- include/libcamera/base/utils.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 0b7407f77..2cb8e0a88 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -110,8 +110,7 @@ std::string join(const Container &items, const std::string &sep, UnaryOp op) std::ostringstream ss; bool first = true; - for (typename Container::const_iterator it = std::begin(items); - it != std::end(items); ++it) { + for (auto it = std::begin(items); it != std::end(items); ++it) { if (!first) ss << sep; else @@ -129,8 +128,7 @@ std::string join(const Container &items, const std::string &sep) std::ostringstream ss; bool first = true; - for (typename Container::const_iterator it = std::begin(items); - it != std::end(items); ++it) { + for (auto it = std::begin(items); it != std::end(items); ++it) { if (!first) ss << sep; else