BAN: Implement String::operator==(const String&)

This commit is contained in:
2023-12-24 13:36:46 +02:00
parent 9b8e6e6629
commit 0e714d5eb4
2 changed files with 11 additions and 0 deletions

View File

@@ -134,6 +134,16 @@ namespace BAN
data()[m_size] = '\0';
}
bool String::operator==(const String& str) const
{
if (size() != str.size())
return false;
for (size_type i = 0; i < m_size; i++)
if (data()[i] != str.data()[i])
return false;
return true;
}
bool String::operator==(StringView str) const
{
if (size() != str.size())