mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Fix string comparison in C++
This commit is contained in:
parent
c3ba10fa90
commit
4910c1fdaa
1 changed files with 9 additions and 0 deletions
|
@ -107,6 +107,15 @@ struct SharedString
|
|||
return std::string_view(a) != std::string_view(b);
|
||||
}
|
||||
|
||||
friend bool operator<(const SharedString &a, const SharedString &b)
|
||||
{ return std::string_view(a) < std::string_view(b); }
|
||||
friend bool operator<=(const SharedString &a, const SharedString &b)
|
||||
{ return std::string_view(a) <= std::string_view(b); }
|
||||
friend bool operator>(const SharedString &a, const SharedString &b)
|
||||
{ return std::string_view(a) > std::string_view(b); }
|
||||
friend bool operator>=(const SharedString &a, const SharedString &b)
|
||||
{ return std::string_view(a) >= std::string_view(b); }
|
||||
|
||||
/// Writes the \a shared_string to the specified \a stream and returns a reference to the
|
||||
/// stream.
|
||||
friend std::ostream &operator<<(std::ostream &stream, const SharedString &shared_string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue