Fixes for C++20 support.
* u8"" no longer generates a char*. Since "" can already accept UTF-8-
encoded text, just use that.
* Both operands to comparison operators should be the same type.
Bug: chromium:1284275
Change-Id: I76ac56f0303ccc843a0c3f723a2096d1aedd079e
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3629720
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Mark Foltz <mfoltz@chromium.org>
diff --git a/cast/common/public/receiver_info_unittest.cc b/cast/common/public/receiver_info_unittest.cc
index a7b16e2..1c3dd27 100644
--- a/cast/common/public/receiver_info_unittest.cc
+++ b/cast/common/public/receiver_info_unittest.cc
@@ -149,7 +149,7 @@
// Note: Includes bits set that are not known:
{"ca", "208901"},
{"cd", "FED81089FA3FF851CF088AB33AB014C0"},
- {"fn", u8"⚡ Yurovision® ULTRA™"},
+ {"fn", "⚡ Yurovision® ULTRA™"},
{"ic", "/setup/icon.png"},
{"id", "4ef522244a5a877f35ddead7d98702e6"},
{"md", "Chromecast Ultra"},
@@ -176,7 +176,7 @@
EXPECT_TRUE(info.capabilities & (kHasVideoOutput | kHasAudioOutput));
EXPECT_EQ(info.status, kBusy);
EXPECT_EQ(info.model_name, "Chromecast Ultra");
- EXPECT_EQ(info.friendly_name, u8"⚡ Yurovision® ULTRA™");
+ EXPECT_EQ(info.friendly_name, "⚡ Yurovision® ULTRA™");
}
} // namespace cast
diff --git a/cast/streaming/expanded_value_base.h b/cast/streaming/expanded_value_base.h
index d7d3263..56e9ad4 100644
--- a/cast/streaming/expanded_value_base.h
+++ b/cast/streaming/expanded_value_base.h
@@ -124,12 +124,24 @@
}
// Comparison operators.
- constexpr bool operator==(Subclass rhs) const { return value_ == rhs.value_; }
- constexpr bool operator!=(Subclass rhs) const { return value_ != rhs.value_; }
- constexpr bool operator<(Subclass rhs) const { return value_ < rhs.value_; }
- constexpr bool operator>(Subclass rhs) const { return value_ > rhs.value_; }
- constexpr bool operator<=(Subclass rhs) const { return value_ <= rhs.value_; }
- constexpr bool operator>=(Subclass rhs) const { return value_ >= rhs.value_; }
+ constexpr bool operator==(const ExpandedValueBase& rhs) const {
+ return value_ == rhs.value_;
+ }
+ constexpr bool operator!=(const ExpandedValueBase& rhs) const {
+ return value_ != rhs.value_;
+ }
+ constexpr bool operator<(const ExpandedValueBase& rhs) const {
+ return value_ < rhs.value_;
+ }
+ constexpr bool operator>(const ExpandedValueBase& rhs) const {
+ return value_ > rhs.value_;
+ }
+ constexpr bool operator<=(const ExpandedValueBase& rhs) const {
+ return value_ <= rhs.value_;
+ }
+ constexpr bool operator>=(const ExpandedValueBase& rhs) const {
+ return value_ >= rhs.value_;
+ }
// (De)Serialize for transmission over IPC. Do not use these to subvert the
// valid set of operators allowed by this class or its Subclass.