mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
String: Define operator>(String)
This commit is contained in:
parent
fbdd0def47
commit
96f9e6a64f
1 changed files with 11 additions and 0 deletions
|
@ -44,6 +44,17 @@ bool String::operator<(const String& other) const
|
||||||
return strcmp(characters(), other.characters()) < 0;
|
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()
|
String String::empty()
|
||||||
{
|
{
|
||||||
return StringImpl::the_empty_stringimpl();
|
return StringImpl::the_empty_stringimpl();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue