From 21678b5e79704612f3325966f30d381752ee28c7 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sun, 24 Dec 2023 12:14:09 +0100 Subject: [PATCH] fix error: use of overloaded operator '==' is ambiguous --- vstgui/lib/cstring.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vstgui/lib/cstring.h b/vstgui/lib/cstring.h index 7c1236dd5..a492c6541 100644 --- a/vstgui/lib/cstring.h +++ b/vstgui/lib/cstring.h @@ -221,6 +221,9 @@ class UTF8StringView bool operator== (const UTF8StringPtr otherString) const; bool operator!= (const UTF8StringPtr otherString) const; bool operator== (UTF8StringView otherString) const; + bool operator!= (UTF8StringView otherString) const; + bool operator== (const UTF8String& otherString) const; + bool operator!= (const UTF8String& otherString) const; operator const UTF8StringPtr () const; //----------------------------------------------------------------------------- private: @@ -463,6 +466,26 @@ inline bool UTF8StringView::operator== (UTF8StringView otherString) const return operator==(otherString.str); } +//------------------------------------------------------------------------ +inline bool UTF8StringView::operator!= (UTF8StringView otherString) const +{ + if (byteCount && otherString.byteCount && *byteCount != *otherString.byteCount) + return true; + return operator!= (otherString.str); +} + +//------------------------------------------------------------------------ +inline bool UTF8StringView::operator== (const UTF8String& otherString) const +{ + return otherString == str; +} + +//------------------------------------------------------------------------ +inline bool UTF8StringView::operator!= (const UTF8String& otherString) const +{ + return otherString != str; +} + //----------------------------------------------------------------------------- inline UTF8StringView::operator const UTF8StringPtr () const {