Skip to content

Commit

Permalink
Add operator==(Quotient::Tag, Quotient::Tag)
Browse files Browse the repository at this point in the history
operator==() is not synthesized from non-defaulted operator<=>(), see
https://en.cppreference.com/w/cpp/language/default_comparisons#Implicit_declaration
  • Loading branch information
KitsuneRal committed Nov 6, 2024
1 parent 3c9780c commit fc36d45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Quotient/events/accountdataevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ constexpr inline auto ServerNoticeTag = "m.server_notice"_L1;

using TagRecord [[deprecated("Use Tag from csapi/definitions/tag.h instead")]] = Tag;

inline std::partial_ordering operator<=>( //
inline std::partial_ordering operator<=>(
const Tag& lhs, const Tag& rhs) // clazy:exclude=function-args-by-value
{
// Per The Spec, rooms with no order should be after those with order,
Expand All @@ -24,6 +24,11 @@ inline std::partial_ordering operator<=>( //
: *lhs.order <=> *rhs.order;
}

inline bool operator==(const Tag& lhs, const Tag& rhs) // clazy:exclude=function-args-by-value
{
return std::is_eq(lhs <=> rhs);
}

using TagsMap = QHash<QString, Tag>;

DEFINE_SIMPLE_EVENT(TagEvent, Event, "m.tag", TagsMap, tags, "tags")
Expand Down

0 comments on commit fc36d45

Please sign in to comment.