|
@@ -19,6 +19,20 @@ bool String::operator==(const String& other) const
|
|
|
return !memcmp(characters(), other.characters(), length());
|
|
|
}
|
|
|
|
|
|
+bool String::operator==(const StringView& other) const
|
|
|
+{
|
|
|
+ if (!m_impl)
|
|
|
+ return !other.m_characters;
|
|
|
+
|
|
|
+ if (!other.m_characters)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ if (length() != other.length())
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return !memcmp(characters(), other.characters_without_null_termination(), length());
|
|
|
+}
|
|
|
+
|
|
|
bool String::operator<(const String& other) const
|
|
|
{
|
|
|
if (!m_impl)
|