Skip to content

Commit 57a1329

Browse files
tequdevdangell7
andauthored
Fix lexicographical_compare_three_way build error at macos (#391)
Co-authored-by: Denis Angell <dangell@transia.co>
1 parent daf22b3 commit 57a1329

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/ripple/basics/base_uint.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ using uint128 = base_uint<128>;
549549
using uint160 = base_uint<160>;
550550
using uint256 = base_uint<256>;
551551

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

567566
// a == b
@@ -571,8 +570,7 @@ operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
571570
return (*ret.first > *ret.second) ? std::strong_ordering::greater
572571
: std::strong_ordering::less;
573572
}
574-
*/
575-
573+
#else
576574
template <std::size_t Bits, class Tag>
577575
[[nodiscard]] inline constexpr std::strong_ordering
578576
operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
@@ -584,6 +582,7 @@ operator<=>(base_uint<Bits, Tag> const& lhs, base_uint<Bits, Tag> const& rhs)
584582
rhs.cend(),
585583
std::compare_three_way{});
586584
}
585+
#endif
587586

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

0 commit comments

Comments
 (0)