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>
This commit is contained in:
Barnabás Pőcze 2024-12-05 09:23:06 +00:00 committed by Laurent Pinchart
parent f1bc9edb46
commit 737fb452fc

View file

@ -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: