mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +00:00
String: Define operator>(String)
This commit is contained in:
parent
fbdd0def47
commit
96f9e6a64f
|
@ -44,6 +44,17 @@ bool String::operator<(const String& other) const
|
|||
return strcmp(characters(), other.characters()) < 0;
|
||||
}
|
||||
|
||||
bool String::operator>(const String& other) const
|
||||
{
|
||||
if (!m_impl)
|
||||
return other.m_impl;
|
||||
|
||||
if (!other.m_impl)
|
||||
return false;
|
||||
|
||||
return strcmp(characters(), other.characters()) > 0;
|
||||
}
|
||||
|
||||
String String::empty()
|
||||
{
|
||||
return StringImpl::the_empty_stringimpl();
|
||||
|
|
Loading…
Reference in a new issue