libcamera: base: utils: join(): Don't use const_iterator directly
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 <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user