Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in operator<, operator> of Utf8String, Utf16String #1114

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/game/common/system/asciistring.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,18 @@ class Utf8String
friend bool operator==(Utf8String const &left, Utf8String const &right) { return left.Compare(right) == 0; }
friend bool operator==(Utf8String const &left, const char *right) { return left.Compare(right) == 0; }
friend bool operator==(const char *left, Utf8String const &right) { return right.Compare(left) == 0; }

friend bool operator!=(Utf8String const &left, Utf8String const &right) { return left.Compare(right) != 0; }
friend bool operator!=(Utf8String const &left, const char *right) { return left.Compare(right) != 0; }
friend bool operator!=(const char *left, Utf8String const &right) { return right.Compare(left) != 0; }

friend bool operator<(Utf8String const &left, Utf8String const &right) { return left.Compare(right) < 0; }
friend bool operator<(Utf8String const &left, const char *right) { return left.Compare(right) < 0; }
friend bool operator<(const char *left, Utf8String const &right) { return right.Compare(left) >= 0; }
friend bool operator<(const char *left, Utf8String const &right) { return !(right.Compare(left) < 0); }

friend bool operator>(Utf8String const &left, Utf8String const &right) { return left.Compare(right) > 0; }
friend bool operator>(Utf8String const &left, const char *right) { return left.Compare(right) < 0; }
friend bool operator>(const char *left, Utf8String const &right) { return right.Compare(left) >= 0; }
friend bool operator>(Utf8String const &left, const char *right) { return left.Compare(right) > 0; }
friend bool operator>(const char *left, Utf8String const &right) { return !(right.Compare(left) > 0); }

friend Utf8String operator+(const Utf8String &a, const Utf8String &b)
{
Expand Down
4 changes: 2 additions & 2 deletions src/game/common/system/unicodestring.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ class Utf16String

friend bool operator<(Utf16String const &left, Utf16String const &right) { return left.Compare(right) < 0; }
friend bool operator<(Utf16String const &left, const unichar_t *right) { return left.Compare(right) < 0; }
friend bool operator<(const unichar_t *left, Utf16String const &right) { return right.Compare(left) < 0; }
friend bool operator<(const unichar_t *left, Utf16String const &right) { return !(right.Compare(left) < 0); }

friend bool operator>(Utf16String const &left, Utf16String const &right) { return left.Compare(right) > 0; }
friend bool operator>(Utf16String const &left, const unichar_t *right) { return left.Compare(right) > 0; }
friend bool operator>(const unichar_t *left, Utf16String const &right) { return right.Compare(left) > 0; }
friend bool operator>(const unichar_t *left, Utf16String const &right) { return !(right.Compare(left) > 0); }

public:
static Utf16String const s_emptyString;
Expand Down
Loading