diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2024-12-05 09:23:06 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-12-05 22:29:57 +0200 |
commit | 737fb452fc3bb8a8513ddbf527f4836b9d32d2a5 (patch) | |
tree | d6dab23cd00c474c0b5f45e8a8f4f4b9b502ad0b /include | |
parent | f1bc9edb46551039e4b8c14e535300ce942bef9b (diff) |
libcamera: utils: StringSplitter: Add `operator==`
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 <pobrn@protonmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/base/utils.h | 7 |
1 files changed, 6 insertions, 1 deletions
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: |