Skip to content

Commit

Permalink
Address reviewer's feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Dec 10, 2024
1 parent 4402951 commit cc4a9c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
5 changes: 4 additions & 1 deletion include/xrpl/protocol/Issue.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class Issue

bool
native() const;

friend constexpr std::weak_ordering
operator<=>(Issue const& lhs, Issue const& rhs);
};

bool
Expand Down Expand Up @@ -95,7 +98,7 @@ operator==(Issue const& lhs, Issue const& rhs)

/** Strict weak ordering. */
/** @{ */
[[nodiscard]] inline constexpr std::weak_ordering
[[nodiscard]] constexpr std::weak_ordering
operator<=>(Issue const& lhs, Issue const& rhs)
{
if (auto const c{lhs.currency <=> rhs.currency}; c != 0)
Expand Down
19 changes: 17 additions & 2 deletions include/xrpl/protocol/MPTIssue.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ class MPTIssue
void
setJson(Json::Value& jv) const;

auto
operator<=>(MPTIssue const&) const = default;
friend constexpr bool
operator==(MPTIssue const& lhs, MPTIssue const& rhs);

friend constexpr std::weak_ordering
operator<=>(MPTIssue const& lhs, MPTIssue const& rhs);

bool
native() const
Expand All @@ -61,6 +64,18 @@ class MPTIssue
}
};

constexpr bool
operator==(MPTIssue const& lhs, MPTIssue const& rhs)
{
return lhs.mptID_ == rhs.mptID_;
}

constexpr std::weak_ordering
operator<=>(MPTIssue const& lhs, MPTIssue const& rhs)
{
return lhs.mptID_ <=> rhs.mptID_;
}

/** MPT is a non-native token.
*/
inline bool
Expand Down

0 comments on commit cc4a9c0

Please sign in to comment.