From 737fb452fc3bb8a8513ddbf527f4836b9d32d2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 5 Dec 2024 09:23:06 +0000 Subject: libcamera: utils: StringSplitter: Add `operator==` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If `cpp_debugstl` is enabled in the build configuration, then libstdc++ will try to use `==` on operators in certain cases to carry out extra checks. This leads to build failures because `StringSplitter::iterator` has no `operator==`. Implement `operator==`, and express `operator!=` in terms of it. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- include/libcamera/base/utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index c4a06660..780aeda6 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -205,9 +205,14 @@ public: iterator &operator++(); std::string operator*() const; + bool operator==(const iterator &other) const + { + return pos_ == other.pos_; + } + bool operator!=(const iterator &other) const { - return pos_ != other.pos_; + return !(*this == other); } private: -- cgit v1.2.1