Skip to content

Commit

Permalink
Fix lexicographical_compare_three_way build error at macos (#391)
Browse files Browse the repository at this point in the history
Co-authored-by: Denis Angell <[email protected]>
  • Loading branch information
tequdev and dangell7 authored Nov 14, 2024
1 parent daf22b3 commit 57a1329
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ripple/basics/base_uint.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ using uint128 = base_uint<128>;
using uint160 = base_uint<160>;
using uint256 = base_uint<256>;

/*
* template <std::size_t Bits, class Tag>
#ifdef __APPLE__
template <std::size_t Bits, class Tag>
[[nodiscard]] inline constexpr std::strong_ordering
operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
{
Expand All @@ -561,7 +561,6 @@ operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
//
// FIXME: use std::lexicographical_compare_three_way once support is
// added to MacOS.
auto const ret = std::mismatch(lhs.cbegin(), lhs.cend(), rhs.cbegin());

// a == b
Expand All @@ -571,8 +570,7 @@ operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
return (*ret.first > *ret.second) ? std::strong_ordering::greater
: std::strong_ordering::less;
}
*/

#else
template <std::size_t Bits, class Tag>
[[nodiscard]] inline constexpr std::strong_ordering
operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
Expand All @@ -584,6 +582,7 @@ operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
rhs.cend(),
std::compare_three_way{});
}
#endif

template <std::size_t Bits, typename Tag>
[[nodiscard]] inline constexpr bool
Expand Down

0 comments on commit 57a1329

Please sign in to comment.