mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 12:54:45 +00:00
Fix casting of conditional operator
This commit is contained in:
parent
9a935bdd0f
commit
ef9d3963e4
7 changed files with 125 additions and 68 deletions
|
@ -11,6 +11,7 @@ struct SharedString
|
|||
{
|
||||
internal::sixtyfps_shared_string_from_bytes(this, s.data(), s.size());
|
||||
}
|
||||
SharedString(const char *s) : SharedString(std::string_view(s)) { }
|
||||
SharedString(const SharedString &other)
|
||||
{
|
||||
internal::sixtyfps_shared_string_clone(this, &other);
|
||||
|
@ -39,6 +40,15 @@ struct SharedString
|
|||
|
||||
static SharedString from_number(double n) { return SharedString(n); }
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
private:
|
||||
/// Use SharedString::from_number
|
||||
explicit SharedString(double n) { internal::sixtyfps_shared_string_from_number(this, n); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue