From 71f028070995fee16d167fb2ca61945e2652f4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 20 Jan 2026 14:55:45 +0100 Subject: [PATCH] libcamera: base: utils: join(): Don't use `const_iterator` directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example, `std::span` does not have a `const_iterator` typedef before C++23, so compilation fails. Simply use `auto`. The `const` qualifier on `items` should already ensure, that such an iterator will be be used that the container deems appropriate for "const" access. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- 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 0b7407f7..2cb8e0a8 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