diff --git a/shell/platform/common/client_wrapper/include/flutter/encodable_value.h b/shell/platform/common/client_wrapper/include/flutter/encodable_value.h index 3b46f99f63c33..3a191205bbef2 100644 --- a/shell/platform/common/client_wrapper/include/flutter/encodable_value.h +++ b/shell/platform/common/client_wrapper/include/flutter/encodable_value.h @@ -215,6 +215,13 @@ class EncodableValue : public internal::EncodableValueVariant { } return std::get(*this); } + + // Explicitly provide operator<, delegating to std::variant's operator<. + // There are issues with with the way the standard library-provided + // < and <=> comparisons interact with classes derived from variant. + friend bool operator<(const EncodableValue& lhs, const EncodableValue& rhs) { + return static_cast(lhs) < static_cast(rhs); + } }; } // namespace flutter